Octalys
asked on
PHP Warning: filesize() .. stat failed for C:\output\1024364.jpg Why does this happen on windows 2008 IIS server + php 5?
Why does this happen on windows 2008 IIS server + php 5?
This is the exact error I get;
[21-Sep-2011 11:32:01] PHP Warning: filesize() [<a href='function.filesize'>f unction.fi lesize</a> ]: stat failed for C:\output\1024364.jpg
Before I move the file from the tmp directory, I check its filesize there succesfully, so the function is working.
And I can read the jpg and delete it in the same script, so permissions should be enough to stat it.
Its really confusing me! Thank you
--
1) What my script does is, it checks the filesize in the tmp directory and save it in $filesize
2) Then I move the file to c:\output directory
3) Compare filesize() with $filesize
4) read the jpg and delete it afterwards.
Everything works except step 3.
This is the exact error I get;
[21-Sep-2011 11:32:01] PHP Warning: filesize() [<a href='function.filesize'>f
Before I move the file from the tmp directory, I check its filesize there succesfully, so the function is working.
And I can read the jpg and delete it in the same script, so permissions should be enough to stat it.
Its really confusing me! Thank you
--
1) What my script does is, it checks the filesize in the tmp directory and save it in $filesize
2) Then I move the file to c:\output directory
3) Compare filesize() with $filesize
4) read the jpg and delete it afterwards.
Everything works except step 3.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Somehow after the file has been moved in the c:\output directory, it is still not available for filesize().
I found out by adding a is_readable() while loop before doing filesize()
I found out by adding a is_readable() while loop before doing filesize()
i suppose it may not be finding the image to execute the filesize function...or may its the temp file which doesn't actually moving the file format