1

Weird... Originally i thought that php was not correctly handling large file uploads (800mb-2gb)

now i've figured out that the file is moved correctly, but the mysql query that enters the file info into the DB seems to be skipped when large files are uploaded.

The mysql query is executed like it should be when small files are uploaded. This problem only seems to arise with larger files

Also, the mysql queries before the file is moved seem to work fine.

Process:

Wait for uploaded file, 
check file size, 
get md5 of file, 
move file from temp folder to uploads folder, 
if moving file is successful then mysql query.

The file is where is should be, but the query isnt executed.

Should i put a 10 second delay between after the file is moved and when the mysql query is called?

jiexi
  • 3,019
  • 7
  • 26
  • 28

2 Answers2

2

If the file move is working than the problem is most likely on the last step - the MySQL query. Max out the error level with error_reporting(E_ALL) and setup a PHP error log - this will record any MySQL warnings and any other problems. Log the SQL query you're trying to execute. Does it work from a MySQL client?

leepowers
  • 37,828
  • 23
  • 98
  • 129
  • turns out that the mysql connect established at the beginning of the script was timing out by the time the file upload had finished. – jiexi Nov 03 '10 at 01:36
0

It sounds like large files are not being moved from the temp folder successfully? Can you confirm this by seeing if the file is still there in /tmp or wherever?

makdad
  • 6,402
  • 3
  • 31
  • 56
  • it seems that the tmp folder is empty. only residual folders left over, nothing more. – jiexi Nov 03 '10 at 01:20
  • and, there are echos in the if(move(blahfile, blahnewfile)) statement that are working fine, its the mysql query that seems to only work when smaller files are uploaded – jiexi Nov 03 '10 at 01:20