Storing binary data in mySQL
| From: | Jacob Kruger | Date: | Tue, 25 Oct 2016 07:58:12 +0000 |
| Subject: | Storing binary data in mySQL | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-31424@lists.php.net to get a copy of this message | ||
I have a minor issue with storing specific types of data in a blob field in mySQL.
I am working with PDO, and while it seems to work alright with image files, etc., if I try to store a sound clip in the database, using exact same code, etc., when I then pull the data out of the database again, setting content-disposition, file name, content-type, etc. back to match the original values, the audio clips seem to get corrupted when being extracted?
Any thoughts on what I need to bear in mind/try while extracting, or storing the data?
Can also post the code here, but, thought would first just ask, since when I do the exact same thing with image files, they seem fine when they then get extracted/rendered.
Suppose should also try some other file types, like documents, PDF files, etc., just to test, but, just find it a bit odd that one type of file - .jpg, .gif, or .png - works fine, but, others, like .wav, .mp3 and .ogg don't want to cooperate.
TIA
Jacob Kruger
Blind Biker
Skype: BlindZA
"Resistance is futile, but, acceptance is versatile..."