1

My clients are on a hosting provider where the max upload size is 1Mb, and I can't increase that limit. They want to be able to upload images bigger than 1Mb, and have the server resize them.

I would like to reduce the image filesize (in any possible way, reducing width/height is an option) before it gets uploaded and processed by php.

I've seen some jQuery plugins that allow you to crop a part of the picture before uploading it, but that's not exactly what I'd like.

Ideally I would use a plugin that intercepts the form submission, reduces the image's size and then proceeds submitting the form. Although I haven't found such a plugin so far. In case there is nothing already developed to solve this, is there any way of doing this?

aurbano
  • 3,324
  • 1
  • 25
  • 39
  • 1
    If the server is preventing you from uploading bigger than 1M then the server will never be able to resize them. This post talks about doing so via HTML 5. http://stackoverflow.com/questions/2434458/image-resizing-client-side-with-javascript-before-upload-to-the-server – Leeish Jan 14 '13 at 18:26
  • 1
    @Leeish I know, that's why I'm asking if there is any known way of doing so client-side via jQuery. In that answer they say it might be possible with canvas but I haven't found any working implementations around – aurbano Jan 14 '13 at 18:34
  • The first answer in that post gives a link to an exmaple of how to do it. You cannot do it via just javascript. The browser (without the help of HTML 5) cannot resize and resample the image for saving. The only other option (besides your server) is the clients computer. Unless you want to take control of it, you are out of luck without HTML 5. – Leeish Jan 14 '13 at 18:36

0 Answers0