RE: [PHP] mysql load_file retreival
| From: | Larry Brown | Date: | Sat, 20 Dec 2003 18:35:35 +0000 |
| Subject: | RE: [PHP] mysql load_file retreival | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-173082@lists.php.net to get a copy of this message | ||
Oops, my bad on the post. I am not sending echo header...just header(...
I thought, based on reading from mysql that it did escape certain
characters. I'll start looking at other possibilities...
-----Original Message-----
From: Chris [mailto:chris@leftbrained.org]
Sent: Saturday, December 20, 2003 1:24 PM
To: PHP List
Subject: RE: [PHP] mysql load_file retreival
LOAD_FILE() shouldn't be escaping the data. Are you actually calling : echo
header()? the header function should not be echoed.
header('Content-type: application/pdf');
echo result[0];
-----Original Message-----
From: Larry Brown [mailto:larry.brown@dimensionnetworks.com]
Sent: Saturday, December 20, 2003 9:29 AM
To: PHP List
Subject: [PHP] mysql load_file retreival
I have set up a script to recieve a pdf file and store it in a mysql db
using "update db set field=load_file('fileIncludingFile') where id=$id".
Afterwards I can see the file has been uploaded into the blob field
successfully and without errors. Now I want to get the file back out. I
set up a script with "select field from db where id=$id" and used
mysql_query followed by mysql_fetch_row and did echo header("Content-type:
application/pdf"); and then echo result[0]; where result was the row
fetched. I get the prompt to open with pdf but pdf fails. I have
magicquotes on but I understand that the load_file() function within mysql
does the escaping etc. How can I "un-escape" the data? The only thing I
saw on the mysql manual is on how to use load_file_infile/load_file_outfile
which does not apply to this. Can someone lend a hand here?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php