Re: [PHP] PHP/Mysql: Making binary field available for download - extra browser window ?
On Fri, June 2, 2006 12:59 am, Matthew Pegg wrote: > Working on a PHP script at the moment where I want to be able to > extract a file (PDF file) from a mysql database\ That's bad. Read the archives. > and force the popup > of the File Download dialog, to allow the user to either save or open > the document (ie. and bypass loading the file using the browser's > plugin) Any browser that does't do a download prompt for that is severely broken. Forget the content-disposition crap. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/Mysql: Making binary field available for download - extra browser window ?
Matthew Pegg wrote: Hi all, Working on a PHP script at the moment where I want to be able to extract a file (PDF file) from a mysql database and force the popup of the File Download dialog, to allow the user to either save or open the document (ie. and bypass loading the file using the browser's plugin) I've found solutions on the net for doing this with a file using readfile() but if I can get away with it, I don't want to create temporary files... not having temporary files and even the code you use have nothing to do with the extra window problem - that is a client side issue over which php has no control .. it's down to the browser settings (possibly) or (more likely) the target attribute of the link in question. Here's what I've got so far (truncated...): print $pdf_brochure;// < problem might be here exit(); ?> This almost works but the problem is that this code still spawns a new empty browser window, and I don't know how to prevent this Can anyone help ? don't open a new window to download it then ... i.e. don't use 'target="_blank"' in the html defintion of the relevant link. regards, Matt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP/Mysql: Making binary field available for download - extra browser window ?
Hi, In this case I usually creating Iframe with zero with and zero height and using your "header" code in the iframe sorce file. DS -Original Message- From: Matthew Pegg [mailto:[EMAIL PROTECTED] Sent: Friday, June 02, 2006 7:59 AM To: php-general@lists.php.net Subject: [PHP] PHP/Mysql: Making binary field available for download - extra browser window ? Hi all, Working on a PHP script at the moment where I want to be able to extract a file (PDF file) from a mysql database and force the popup of the File Download dialog, to allow the user to either save or open the document (ie. and bypass loading the file using the browser's plugin) I've found solutions on the net for doing this with a file using readfile() but if I can get away with it, I don't want to create temporary files... Here's what I've got so far (truncated...): This almost works but the problem is that this code still spawns a new empty browser window, and I don't know how to prevent this Can anyone help ? regards, Matt. -- ___ Matt Pegg IT Specialist Abacus Business Machines Ballarat, Australia. ___ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP/Mysql: Making binary field available for download - extra browser window ?
Hi all, Working on a PHP script at the moment where I want to be able to extract a file (PDF file) from a mysql database and force the popup of the File Download dialog, to allow the user to either save or open the document (ie. and bypass loading the file using the browser's plugin) I've found solutions on the net for doing this with a file using readfile() but if I can get away with it, I don't want to create temporary files... Here's what I've got so far (truncated...): This almost works but the problem is that this code still spawns a new empty browser window, and I don't know how to prevent this Can anyone help ? regards, Matt. -- ___ Matt Pegg IT Specialist Abacus Business Machines Ballarat, Australia. ___