Jump to content

PHP Blob Issues


millwardt

Recommended Posts

Hi Guys,

 

Hoping somebody is able to help me, I'm fairly new to PHP!

 

I have a script for uploading files and inserting them into a MySQL table as blobs which works fine.

 

I can preview the file types in the MySQL browser and they are perfect, however when I download the files, there seem to be some issues.

 

PDF and MP3 work fine, and are displayed / played.

Images - JPEG GIF and PNG tell me that the files are corrupted, as do Microsoft Word documents - however they are not corrupt in the database.

 

Any ideas on how to solve this?

 

Thanks

 

Link to comment
Share on other sites

I can't tell you how to solve your specific problem, but I can give you a best practice.  Best practice for storing large files such as images and audio in a database is don't do it.  Instead store a link to the file in the database.  Experienced database admins will tell you this and most experienced and inexperienced people (like myself) on this forum will tell you this.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.