PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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?
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.
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).
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?
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.