Click here to Skip to main content
15,888,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use a form <form enctype="multipart/form-data"...

to upload files. And then the php code:

PHP
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target_path))
            {
                echo "ok";
            }
            else
            {
             echo "not ok<br>";
            }


This form so far have uploaded more than 10000 files (.apk type - android apps). Problem is, I noticed now that for some files don't work. I tried rename it for 1.apk (for example), it's not a size thing nor permission (i did a chmod 777 on those test files and on the target path just to make sure), but for some reason, for those files that are absolutely similars to the other ones, but I get the no ok notification.

Anyone is seeing something I'm not seeing ? My problem is really not finding a problem pattern so I can solve it!

I have

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


But I get nothing, but still dont know what is the problem. Also tried

if(copy($HTTP_POST_FILES['uploaded']['tmp_name'], $target_path))

but still dont work.
Posted
Updated 5-Jul-11 8:43am
v5
Comments
#realJSOP 5-Jul-11 15:21pm    
There's always a reason, and it's almost always the fault of the programmer.
Maxdd 7 5-Jul-11 15:22pm    
I just found out that was not the cause.

After using $_FILES['uploaded']['error'] this output 1 value, which means that the file is bigger than defined on the php.ini directive - the one I dont have access.

1 solution

If you can't change the settings to accept the larger files, then you can't fix it. If you can't find a cause at all, I'd suggest the cause is a flaky connection, if the files sometimes drop out, you'll look at the code forever and never find a cause there.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900