Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP fread funtion causes IE to fail

Status
Not open for further replies.

ggastelum

Programmer
Oct 7, 2002
27
0
0
US
I am creating an email with attachment using PHP on a website I am working on. The file is a zip file. The
version of IE is 6.0. I read the attachment into a variable
then attach the variable to the email. The error I get
is: "Cannot find server" with the following explanation:

The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings.

The code for the read is as follows:

$var = '';
if($fp = fopen($file, 'rb')) {
while (!feof($fp)) {
$var .= fread($fp, 1024);
}
fclose($fp);
return $var;
}

If I comment out the line "$var .= fread($fp, 1024);"
IE works just fine. If I skip the fread function and
just attach the file to the email the zip file is
corrupted. For the Mozilla browser 1.3.1 I have no
issues. Could it be that I am doing something else
wrong that is causing IE to break? Any help would be
appreciated.

Thanks,
George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top