Hi all
I'm working on some code to upload to a website cms via PHP.
The script works fine up to 500k but errors on anything over at about 90
seconds.
The php.INI file has
max_execution_time=1200
max_input_time=1200
memory_limit=100M
post_max_size=100M
upload_max_filesize=100M
max_file_size=100M
post_max_size=100M
if((!empty($_FILES["uploaded_file"])) &&
$_FILES['uploaded_file']['error']==0 ) {
**************** The file $_FILES['uploaded_file']['error'] always equals 2
at this point for large files. but is fine for smaller files.
$filename = basename($_FILES['uploaded_file']['name']);
$ext = substr($filename, strrpos($filename, '.') + 1);
//Determine the path to which we want to save this file
$newname = dirname(__FILE__).'/upload/'.$filename;
//Check if the file with the same name is already exists on the server
if (!file_exists($newname)) {
//Attempt to move the uploaded file to it's new place
if ((move_uploaded_file($_FILES['uploaded_file']['tmp_name'],$newname)))
{
echo "File " . $filename ." has been succcessfully transferred.<br>
";
echo "An email confirmation has also been sent to: " .
$_POST['fldemail'];
}
else
{
echo "Error: A problem occurred during file upload!";
}
} else
{
echo "Error: File ".$_FILES["uploaded_file"]["name"]." already
exists";
}
} else
{
echo "<br><br>Error: No file uploaded";
echo "The error returned was ";
echo $_FILES['uploaded_file']['error'];
}
Appreciate it if anyone can shed any light because this is driving me nuts.
Regards
Graham
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.