Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

File upload to MySQL

Codes here !

Moderators: macek, egami, gesf

File upload to MySQL

Postby moorstream » Thu Jul 10, 2003 2:45 am

Hej!

Have made a PHP script where I upload files to an SQL database. Unfortunately only partial files are uploaded and all have the same size: 32767 bytes. The field is mediumblob and should be able to hold larger files.

What are possible reasons for that? Could filesize be limited at my ISP (http://www.b-one.nu) in for example php.ini or my.cnf?

/Moorstream
moorstream
New php-forum User
New php-forum User
 
Posts: 5
Joined: Thu Jul 10, 2003 2:39 am

Re: File upload to MySQL

Postby swirlee » Thu Jul 10, 2003 10:21 am

moorstream wrote:Could filesize be limited at my ISP (http://www.b-one.nu) in for example php.ini or my.cnf?


Yep. It's likely the case that either post_max_size or upload_max_filesize in php.ini has been set to a lower value. To find out, use the phpinfo() function to show your configuration variables like so:

Code: Select all
<? phpinfo(INFO_CONFIGURATION); ?>


If that seems to be the problem, you can try to override the setting by using ini_set() at the beginning of your script, but that may or may not work. Also, don't forget that PHP looks for the contents of a hidden form field with the name MAX_FILE_SIZE. Try setting this to something higher.

It's also worth noting that if you plan on accessing the uploaded data frequently (if, for example, they are images that are part of the layout of your site), storing them in a database is less efficient than simply saving them as files.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back


Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.