adamslionel@hotmail.com (lion) wrote in message news:<1f72d2de.0312081336.23484ace@posting.google. com>...[color=blue]
> I get these errors when uploading images via a web page:
> (the page still uploads the images but reports these errors?)
>
> Warning: fopen(D:\php\uploadtemp\php1FC7.tmp) [function.fopen]: failed
> to create stream: No error in
> D:\webspace\me.co.uk\wwwroot\test\Live.php on line 105
>
> Warning: Wrong parameter count for filesize() in
> D:\webspace\me.co.uk\wwwroot\test\Live.php on line 109
>
> Warning: fread(): supplied argument is not a valid stream resource in
> D:\webspace\me.co.uk\wwwroot\test\Live.php on line 109
>
> Warning: Cannot modify header information - headers already sent by
> (output started at D:\webspace\me.co.uk\wwwroot\test\Live.php:105) in
> D:\webspace\me.co.uk\wwwroot\test\Live.php on line 138
>
> This is the code at these errors:
>
> 105 = // Open file for binary reading ('rb')
> $tempfile = fopen($uploadfile0,$uploadfile1,'rb');
>
> 109 = // Read the entire file into memory using PHP's
> // filesize function to get the file size.
> $filedata = fread($tempfile,filesize($uploadfile0,$uploadfile1 ));
>
> 138 = header('location: ' . $_SERVER['PHP_SELF']);
>
> any one help?
>
> I don't get this problem locally on apache 1.3.26 (win32) running php
> 4.2.2 BUT this happens when i use the same file on my live server
> running php 4.3.0 on Windows NT
>
> cheers Lion[/color]
Hi,
Please check the following:
LINE 105: fopen() function takes only a single file name argument and
the mode.
LINE 109: filesize() function takes only a single argument
LINE 138: With above two errors fixed this error will also get fixed.
Following is the correct syntax
fopen: resource fopen ( string filename, string mode [, int
use_include_path [, resource zcontext]] )
filesize: int filesize ( string filename )
-- Rahul