I've had a similar problem. The issue was that Norton Personal Firewall was corrupting the download...I have no idea why. To make it work, I had to use mod_rewrite to make the URL look like a normal file URL, then I found out that it would only work over HTTPS.....again, no idea why. If the user has Norton Peronsal Firewall, ask them to disable it and try again.
On Fri, 09 Jul 2004 13:11:36 -0400, Scott Taylor <[EMAIL PROTECTED]> wrote: > <> > I've gotten this one report of having a problem downloading a PDF: > > "I have tried twice, both times its starts to download but stops about > half way or three-quarters the way complete. I get a error message that > the download was not completed. When I go to look at the message there > is just numbers. I have tried to download again but the "numbers" show > up and it won't let me try again." > > This only happens for this person with one file - the rest of the files > work fine. I am streaming the file with this code: > > // will return FALSE if the file is not found > // will not return anything if the file is found because the headers should > // have already been sent. > function streamfile($file) > { > if (file_exists($file)) > { > > $extension = strtolower(stristr($file, ".")); > > if ($extension == ".php" || $extension == ".html" || $extension > == ".htm" || $extension == ".shtml") { > include ($file); > } > else if ($extension == ".txt") > { > ?> > <html> > <body> > <pre> > <? include($file);?> > </pre> > </body> > </html> > <? > } > else { > > // a switch would be perfect here, > // but it just didn't work last time...it was always > // taking the 'default:' case > if ($extension == ".doc"){$type = "application/msword";} > else if ($extension == ".pdf"){$type = "application/pdf";} > else if ($extension == ".exe"){$type = > "application/octet-stream";} > else if ($extension == ".ppt"){$type = > "application/vnd.ms-powerpoint";} > else if ($extension == ".xls"){$type = > "application/vnd.ms-excel";} > else if ($extension == ".xml"){$type = "text/xml";} > else if ($extension == ".zip"){$type = "application/zip";} > else if ($extension == ".txt"){$type = "text/plain";} > else { > $type="application/octet-stream"; > } > > header("Content-Type: " . $type); > header("Accept-Ranges: bytes"); > header("Content-Length: ".filesize($file)); > header("Content-Disposition: attachment; > filename=".basename($file).";"); > //readfile($file); > > $fp = fopen($file, 'rb'); > $buffer = fpassthru($fp); > fclose($fp); > exit(); > > } > return TRUE; > > } > else > { > return FALSE; > } > } > > Anyone have any ideas? It would be appreciated. > > Scott > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > !DSPAM:40eed02516717083715592! > > -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php