Posted by Jeff on 01/18/07 12:46
"Rik" <luiheidsgoeroe@hotmail.com> wrote in message
news:acd3$45af644d$8259c69c$12826@news2.tudelft.nl...
> Jeff wrote:
>> Hey
>>
>> The code below gives this error message when I submit a file:
>> Warning: filesize() [function.filesize]: stat failed for
>> C:\WINDOWS\TEMP\php3D.tmp in C:\Inetpub\wwwroot\demo\pic.php on line
>> 18
>>
>> What am I doing wrong here? is it because the parameter to filesize()
>> is actually a temp file?
>
>> <?php
>> if (!empty($_FILES["userfile"])) {
>> $instr = fopen($_FILES['userfile']['tmp_name'], "rb");
>> $file = $_FILES['userfile']['tmp_name'];
>> echo filesize($file);
>> }
>> ?>
>
> What happens if you close the filehandle (fclose($instr)) before polling
> for filesize? Or you retrieve the fileszie before fopen()ing it?
>
> Then again, why not use $_FILES['userfile']['size']...
> --
> Rik Wasmus
>
>
thanks for the $_FILES['userfile']['size'] tip, it works now...
Navigation:
[Reply to this message]
|