MySQL Forums
Forum List  »  PHP

MySQL Data Retrieval from Blob Query
Posted by: Dene Stringfellow
Date: January 14, 2022 09:53AM

I'm trying to recover documents from a MySQL sql dump of a past supplied backup that have been stored under a mediumblob field. So far I've had no success recovering any of the files that are PDFs according to the associated filename field.
So far all attempts to download the stored files have failed using php, phpmyadmin and MySQL Workbench. I've successfuly tested base64 encoding and decoding PDFs from the commandline and can see that base64 encoded files when viewed in a raw text editor start with the following text: JVBER.
When I try to download the files using php, phpmyadmin or MySQL Workbench all that is returned are either unreadable PDFs (PHP), binary files (phpmyadmin) or raw text (MySQL Workbench). Using phpmyadmin the size of the file/data stored as a mediumblob is least returned.
Simply changing the file extension from .bin to .pdf does not allow any of the extracted PDfs to be opened. Adobe Reader just splits out the following error: "Adobe Acrobat Reader could not open 'application.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)." Further research and tests indicate that the mediumblob data has been stored as application/octet-streams.
My question is: Is there any means within MySQL of detecting how the mediumblob data was encoded or is there some reference that might list all possible encoding methods?
Any assistance would be greatly appreciated.

Options: ReplyQuote

Written By
MySQL Data Retrieval from Blob Query
January 14, 2022 09:53AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.