Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End PHP-Uploader Re: PHP-Uploader

#71487
Paradox
Member

Ok, now I’ve changed my entire code, I actually got it from http://www.zymic.com/tutorials/php/creating-a-file-upload-form-with-php/comments/, and here it is:

upload.php

Code:
$max_filesize)
die(‘The file you attempted to upload is too large.’);

// Check if we can upload to the specified path, if not DIE and inform the user.
if(!is_writable($upload_path))
die(‘You cannot upload to the specified directory, please CHMOD it to 777.’);

// Upload the file to your specified path.
if(move_uploaded_file($_FILES[‘userfile’][‘tmp_name’],$upload_path . $filename))
echo ‘Your file upload was successful, view the file here‘; // It worked.
else
echo ‘There was an error during the file upload. Please try again.’; // It failed :(.

?>

index.php

Code:


My example website: http://www.knuddels-hosting.de/php/testsite.php

Following error occurs: "There was an error during the file upload. Please try again."