All4172 Posted May 1, 2007 Share Posted May 1, 2007 I'm working with a simple upload script where users can upload pic files and the rest. The pics are of professional variety so they can be quite large (20MB -60MB). When I run a test file that is around 3-5 MB's it'll upload fine. However, when I began to attempt to upload files that are 15-20+ MB's it seems to do nothing. I'm guessing the server is timing out? Is there anything I can add to the below script so a server doesn't time out? <?php $target = "upload/"; $target = $target . basename( $_FILES['uploaded']['name']); $ok=1; $uploaded_size = $_FILES['uploaded']['size']); if ($uploaded_size > 70000000) { echo "Your file is too large. Max file size is 70MB and your file was $uploaded_size<br>"; $ok=0; } //Here we check that $ok was not set to 0 by an error if ($ok==0) { Echo "Sorry your file was not uploaded"; } //If everything is ok we try to upload it else { if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "Target Path - "; echo $target; echo "<BR>File Size - "; echo $uploaded_size; echo "<BR>File Name - "; echo basename( $_FILES['uploaded']['name']); } else { echo "Sorry, there was a problem uploading your file."; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/49484-solved-upload-script-problems/ Share on other sites More sharing options...
MadTechie Posted May 1, 2007 Share Posted May 1, 2007 Search the fourm.. i see these posts about twice a week..! basically edit your php.ini file! Quote Link to comment https://forums.phpfreaks.com/topic/49484-solved-upload-script-problems/#findComment-242539 Share on other sites More sharing options...
All4172 Posted May 1, 2007 Author Share Posted May 1, 2007 Search the fourm.. i see these posts about twice a week..! basically edit your php.ini file! I know that portion but for this site its on a shared host. So access to the .ini file isn't possible. Reason I asked if possible to add anything to the script. Quote Link to comment https://forums.phpfreaks.com/topic/49484-solved-upload-script-problems/#findComment-242542 Share on other sites More sharing options...
MadTechie Posted May 1, 2007 Share Posted May 1, 2007 only options are #1 edit the php.ini file, add post_max_size = 8000000 upload_max_filesize = 8000000 #2 try adding this to your script ini_set('post_max_size', '8M'); ini_set('upload_max_filesize', '8M'); #3 try adding this to your .htaccess file: php_value post_max_size 8M php_value upload_max_filesize 8M **note edit these sizes (i used 8Mb for the examples) Quote Link to comment https://forums.phpfreaks.com/topic/49484-solved-upload-script-problems/#findComment-242556 Share on other sites More sharing options...
TEENFRONT Posted May 1, 2007 Share Posted May 1, 2007 If its on a shared host, you could as your hosting company to increase the limit in the .ini file for you. Quote Link to comment https://forums.phpfreaks.com/topic/49484-solved-upload-script-problems/#findComment-242564 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.