Page 1 of 1
how to upload large file to DB
Posted: Thu Jun 19, 2008 12:34 pm
by freeAngel_007
Hi guys,
I hope i am in right topic
Ok I have a problem with picture uploading.
I have a working HTML form and PHP script which is uploading the file to MySql. But the problem is if i want upload picture with more than 2MB it don`t Work. Is there any way how I can resize and make it smaller that picture on clients side?
I am wondering if it can do JavaScript and then send resized picture to PHP script?
Re: how to upload large file to DB
Posted: Thu Jun 19, 2008 1:12 pm
by hawleyjr
Are you storing the image in the database? If so, don't. Store it in a directory and reference the physical file to the database.
Re: how to upload large file to DB
Posted: Thu Jun 19, 2008 1:23 pm
by w35z0r
And if your going to do that, you might want to check your php.ini file for these lines
Code: Select all
post_max_size = **some number, by default it will be 2M**
upload_max_filesize = **some number, by default it will be 2M**
All you have to do is change that to something more appealing, and you're good to go ... I think...
Re: how to upload large file to DB
Posted: Thu Jun 19, 2008 1:33 pm
by WebbieDave
freeAngel_007 wrote:Is there any way how I can resize and make it smaller that picture on clients side?
No (unless you want to write a browser-plugin and make everyone install it,

)
Try the above suggested configuration changes and also have a look at this thread for some more config changes you may need:
viewtopic.php?f=1&t=84366
Re: how to upload large file to DB
Posted: Thu Jun 19, 2008 3:45 pm
by nowaydown1
Is there any way how I can resize and make it smaller that picture on clients side?
If your purpose for attempting to do so is to reduce downstream filesizes/image sizes, then sure it can be done. You can use either ImageMagick or GD if your PHP installation has those extensions enabled. Its easy enough to generate a smaller version of an image file.
Re: how to upload large file to DB
Posted: Thu Jun 19, 2008 4:24 pm
by Zoxive
WebbieDave wrote:freeAngel_007 wrote:Is there any way how I can resize and make it smaller that picture on clients side?
No (unless you want to write a browser-plugin and make everyone install it,

)
Try the above suggested configuration changes and also have a look at this thread for some more config changes you may need:
viewtopic.php?f=1&t=84366
You don't need a browser-plugin. There are already websites that have this (Facebook as an example), they usually use Java. (Which still requires browser plugin, but Java's not your own custom).
Re: how to upload large file to DB
Posted: Thu Jun 19, 2008 6:39 pm
by jayshields
Zoxive wrote:There are already websites that have this (Facebook as an example), they usually use Java. (Which still requires browser plugin, but Java's not your own custom).
Wait... Facebook's image upload applet resizes images
before it uploads it to the web server?
Re: how to upload large file to DB
Posted: Thu Jun 19, 2008 7:44 pm
by Zoxive
jayshields wrote:Wait... Facebook's image upload applet resizes images before it uploads it to the web server?
Yes, i know for a fact it does. I'm sure it doesn't do all the resizing locally, but it does decrease the file size some way with Java, and then sends the image data to the server.