?
Solved

PHP Warning:  filesize() .. stat failed for C:\output\1024364.jpg  Why does this happen on windows 2008 IIS server + php 5?

Posted on 2011-09-21
3
Medium Priority
?
582 Views
Last Modified: 2012-05-12
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'>function.filesize</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.
0
Comment
Question by:Octalys
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 14

Expert Comment

by:Kalpan
ID: 36572682
don't move the file...use the copy command and once done unlink the temp directory...

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
0
 

Accepted Solution

by:
Octalys earned 0 total points
ID: 36572719
Well technically, I have to move it.

There's another external program outside php that does something with the image, but doesnt change the filesize.

But it doesnt solve my problem either way; the file is there 100%. I read and delete the file in the same script, so why cant I filesize it. That is my problem.
0
 

Author Closing Comment

by:Octalys
ID: 36597828
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()
0

Featured Post

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question