Jump to content

Crazy File Upload Problem


johnsmith153

Recommended Posts

I am using a form to upload files.

 

I have a situation where everything works, including the database action etc required, however depending on the size of the files I upload, I can either get the "completed" message, or I get a 500-internal-error.

 

Remember, everything works, it always does everything it should - it is just sometimes I get the 500 error.

 

If I upload one file anything over 8mb triggers the 500 error.

If I am uploading 2 at same time, it triggers around 5mb.

 

I have set max execution limit, memory limit, max-upload size, max-post size - you name it!

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/158067-crazy-file-upload-problem/
Share on other sites

I have set max execution limit, memory limit, max-upload size, max-post size

Have you checked that those settings are actually in effect using a phpinfo(); statement and what method did you use to set each of them?

 

Also, add the following two lines immediately after your first opening <?php tag -

ini_set("display_errors", "1");
error_reporting(E_ALL);

All the things I mentioned are definitely set - I have checked php info.

 

I have added the lines you mentioned, and I just get a load of rubbish (mainly minor variables not declared etc.)

 

The trouble is I get the same rubbish if I upload a 1mb file as I do if I upload a 20mb file - and with the output I now get javascript errors - so I have had to remove the 2 lines mentioned.

 

Somewhere there must be something stopping php from allowing uploads over 5-8mb???

 

Just another point, part of the process after uploading the files is to have a video encoding API get the file using FTP and then return it (encoded) - so this may be important. Does FTP have settings???

What does the following code show that you are getting?

echo "<pre>";
echo "FILES:";
print_r($_FILES);
echo "</pre>";

 

And among all the rubbish that you are trying to ignore is probably an error that is pointing to the actual reason your code is not working. Posting your code and the errors you did get will get you the quickest answer to what is happening.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.