Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm having an issue getting a mysql (InnoDB) medium blob to display it's image on the HTML page.
Everything works correctly if an an image below 1MB is used.
Anything larger generates an incomplete base64 transmission
of the image and hence an empty box on the page.
This is a known issue according to yahoo searches an I have
implemented everything I can find - 2 lines to add to the
my.ini file to increase packet allotment.
However this has not corrected the problem on my system.
ob_start - end options have been tried as have mysql_flush variations.
Uploads are set to 20MB so a 2MB image shouldn't have trouble but it does.
There must be something configured somewhere that is affecting this
perhaps in php mysql Apache or other ini/cnf but I can't find anything after going through it all.
Does anyone have any hard information of the specific variables
in these .ini/conf files that may be affecting packet sizes or the ability to send a 2MB base64 encoded file from a mysql blob to a html page via php - perhaps there is a cache somewhere that isn't obvious?
I'd really like to get the cause for this nailed down not just
"randomly fixed"
(the code itself clearly works as all smaller imaged transfer fine)
I realize this is not a specific answer to your question.
I manage what you're doing by storing the images outside the database and storing only the location in the database. The db contains descriptions, names of people in the picture, date (it's a Family Photo Album application) and is searchable...but displaying the image is done by writing the location into the img tag and letting the browser pull the image from the filesystem.
base64 - you mean the image gets encoded as text straight into the web page?
not directly answering your question, but this doesn't strike me as a good idea for images larger than a few kilobytes.
imagine the amount of text +1MB would generate, and there's multiple such images in one page?
Thanks jan but this isn't specifically a mySQL issue.
Putting the file into mysql works fine.
I expect your were refering to the response for packet adjustment
but as mentioned in my original I've already done that.
I'm guessing it's a transport or cache issue between mySQL and PHP
or PHP to HTML Apache server - I can't so far identify what however.
Most people have reported increasing that packet-size has solved their
problem - for some reason that isn't working on my system.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.