Date: 10/05/01
- Next message: Rosen: "[PHP] Re: Session ID"
- Previous message: _lallous: "[PHP] Re: How can I simulate the login process?"
- In reply to: David Otton: "Re: [PHP] Downloading Images"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I suggest you call: readfile() instead of include() at the end of your
script!
"David Otton" <david.otton <email protected>> wrote in message
news:a6tortclclf12tqvivh0uuivlo1v0soiio <email protected>
> On Thu, 4 Oct 2001 07:32:17 -0700 (PDT), you wrote:
>
> >I have added a download button to a web-site that
> >enables users to download images to their local
> >drives. (I'm using a button as I want to wrap some
> >logic round this function) I have the following
> >(simplified code )that will be called from the
> >web-site when the button is clicked.
> >
> >header("Content-type: application/octet-stream");
> >header( "Content-Disposition: attachment;
> >filename=01lg.jpg");
> >$filename= "c:/program files/apache
> >group/apache/kidz/gallery/download/01lg.jpg";
> > include($filename);
> >
> >The result is the SaveAs box appears and the image is
> >being downloaded with the correct name however when I
> >try and re-open the image i get the message invalid
> >header. Does anyone have any ideas?
>
> What does the downloaded file look like internally? Open it in a hex
> editor (or even just Notepad). Check the file-lengths of the original
> and copy. My guess is you're saving an error message with a .jpeg
> extension.
>
> djo
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Rosen: "[PHP] Re: Session ID"
- Previous message: _lallous: "[PHP] Re: How can I simulate the login process?"
- In reply to: David Otton: "Re: [PHP] Downloading Images"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

