LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Storing binary data in MySQL take 2 (https://www.linuxquestions.org/questions/programming-9/storing-binary-data-in-mysql-take-2-a-441922/)

drspin 05-05-2006 11:28 AM

Storing binary data in MySQL take 2
 
So PHP has a couple variables that can be set that instill limitations on filesizes and amount of data that can be processed by a form. This is great on all accounts until access to the PHP.ini file is not allowed on the webserver.

My question:

How can I store binary data (JPG, MP3, ZIP) in a MySQL Blob without being affected by the limitations imposed by my hosting provider? I have tried many different methods but they all have one thing in common, they don't work. I'm thinking some Perl will be neceesary but I know nothing about it.

Any assistance that can be offered would be fantastic!!

Thanks -Cole

graemef 05-05-2006 12:43 PM

Have you tried setting a local ini value using ini_set()?

drspin 05-05-2006 02:06 PM

Here is my test script:

Code:

<?php

ini_set('file_uploads', '0');
ini_set('post_max_size', '16M');
ini_set('upload_max_filesize', '16M');

echo ini_get('file_uploads')."<br />";
echo ini_get('post_max_size')."<br />";
echo ini_get('upload_max_filesize')."<br />";

?>

And the OUTPUT:
Code:

1
2M
2M

Looking through the manual on php.net it appears these values are not able to be changed dynamically. There is a hint that it is possible with htaccess but they are not able to be changed on a "perdir" basis according the site so I do not think that will work.

Thanks for the advice though, was something I had not tried -- learned something new as well!! ;)

Cole

graemef 05-05-2006 02:30 PM

Doing a little googling I found that you can put a modified php.ini file in your public_html folder and this should be picked up when your scripts run. I've never tried it but worth a shot?

drspin 05-05-2006 02:56 PM

some quick googling looks like it's a combination of .htaccess and a customized php.ini -- I will test this later today on my box at home but I fear that it may not work on my hosting provider's setup... It is worth a shot and any chance I could convince you to post a link?? I did some quick googling and got some conflicting answers.

graemef 05-05-2006 03:26 PM

Probably the best one, and one that's a little confusing


All times are GMT -5. The time now is 04:53 PM.