download file php
snippet in php

download file php


// Initialize a file URL to the variable 
$url = ''; 
// Use basename() function to return the base name of file  
$file_name = basename($url); 
// Use file_get_contents() function to get the file 
// from url and use file_put_contents() function to 
// save the file by using base name 
if(file_put_contents( $file_name,file_get_contents($url))) { 
    echo "File downloaded successfully"; 
else { 
    echo "File downloading failed."; 

upload file php


<form enctype="multipart/form-data" action="__URL__" method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="30000" />
    Diese Datei hochladen: <input name="userfile" type="file" />
    <input type="submit" value="Send File" />