[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

Reducing filesize locally before upload?

Is it possible to reduce a file size of an image BEFORE its uploaded to my server.
My php uploads have a limit of 2mb I could just increase it but I have about 100 uploads of some quite large images a day onto my site and would like to know if its possible to reduce this locally before it uploads?

My alternative would be asking the visitors to keep the size down before uploading, but  some users dont even know what 2mb means. The easier I can make it the better but at the same time I dont want huge files eating at my bandwidth which is what is happening at the moment!

I know there is imagemagick which is what I am currently using to resize and create thumbnails but I want the original file compressed before upload.

Is this possible?
0
misi_uk
Asked:
misi_uk
1 Solution
 
thehagmanCommented:
Yes, your users can download and install some image manipulating software like GIMP and edit their images (e.g. scale down or reduce jpeg quality) until the size requirements are met.
0
 
hieloCommented:
>>Is it possible to reduce a file size of an image BEFORE its uploaded to my server.
No, YOU can't do this. PHP runs on YOUR server. You don't have access to the user's file system. Your only options are:
a. ask user to resize their files
b. increase the upload limit.

>>I could just increase it but I have about 100 uploads of some quite large images a day onto my site
OK, but if you want small images to begin with, you an increase the upload limit and resize the images yourself once uploaded.
0
 
jmalonsoexpCommented:
You can change the 2mb limit by configuring the server "php.ini"
post_max_size=16m
upload_max_filesize=16m

or if you dont have access to the php.ini in the server you can make these changes in  ".htaccess" file

php_value post_max_size 16 MB
php_value upload_max_filesize 16 MB
php_value max_execution_time 60

I Hope this help you.
0
 
jmalonsoexpCommented:
Other solution is that you give those users ftp access....
0
 
misi_ukAuthor Commented:
Thanks I did think that but wasnt sure if I was missing something somewhere
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now