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
559 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now