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
565 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP: Query an Sqlite3 Datatbase return in JSON 6 49
web & database SERVERS -- PHYSICAL & VM ? 5 55
AWS EC2 & RDS Instance 5 35
Php recording post 4 37
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

776 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