Re: php download problem.



On 30 Aug 2005 11:56:11 -0700, "kevinm3574" <kevintm@xxxxxxxxxxxxx> wrote:

> header("Content-length: " . filesize($path) . "\r\n");
> }
> $fp=fopen($path, 'rb');
> fpassthru($fp);
> fclose($fp);
>
>Download dialogue pops just fine and the file gets saved. However,
>without fail, the file is 2 bytes larger than the source file. I'm
>stumped. Any ideas?

Leading or trailing space in the PHP file?

Have you put the resulting file through a hex editor to find what those two
bytes are? (I think it's a good bet they're \r\n)

You also don't need to put \r\n in calls to header() - this may even be
causing problems.

--
Andy Hassall :: andy@xxxxxxxxxxx :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
.



Relevant Pages

  • Re: renameTo method suddenly stopped working...
    ... of the source file ... for the various reasons renameTo can fail. ... Roedy Green Canadian Mind Products ...
    (comp.lang.java.programmer)
  • Re: C as a scripting language
    ... Mark Wooding wrote: ... The outer loop can be simplified to: ... It will still fail with file names with spaces, but no sane developer has spaces in source file names, do they? ...
    (comp.lang.c)
  • Re: Beginners questions
    ... the variables and express the algebric constraint. ... Note the fail: this force backtracking on all solutions. ... I defined go into the source file ANT+CAT=DOG.pl, ... then moved to plwin to issue the query. ...
    (comp.lang.prolog)
  • Install Error
    ... I'm try to intall VS.Net but fail ... This is screen of erorr messages: ... Error 1308: Source file not found ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Install Error
    ... I'm try to intall VS.Net but fail ... This is screen of erorr messages: ... Error 1308: Source file not found ...
    (microsoft.public.dotnet.languages.vb)