LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-05-2006, 11:28 AM   #1
drspin
LQ Newbie
 
Registered: Dec 2005
Posts: 11

Rep: Reputation: 0
Question 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
 
Old 05-05-2006, 12:43 PM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Have you tried setting a local ini value using ini_set()?
 
Old 05-05-2006, 02:06 PM   #3
drspin
LQ Newbie
 
Registered: Dec 2005
Posts: 11

Original Poster
Rep: Reputation: 0
Exclamation

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
 
Old 05-05-2006, 02:30 PM   #4
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
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?
 
Old 05-05-2006, 02:56 PM   #5
drspin
LQ Newbie
 
Registered: Dec 2005
Posts: 11

Original Poster
Rep: Reputation: 0
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.
 
Old 05-05-2006, 03:26 PM   #6
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Probably the best one, and one that's a little confusing
 
  


Reply

Tags
binary, database, mysql, php


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sockets and Binary data oulevon Programming 3 04-06-2006 04:35 AM
Storing Sound (Media) files in MySQL 1kyle Suse/Novell 2 04-04-2006 09:44 AM
Storing Images in MySQL MRMadhav Programming 14 03-01-2006 11:13 AM
pascal to C problem in struct storing data ngan_yine Programming 6 01-25-2005 03:21 AM
storing multiple values within one field in mysql antken Programming 8 12-15-2002 10:08 PM


All times are GMT -5. The time now is 10:35 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration