/    Sign up×
Community /Pin to ProfileBookmark

Shrinking photos before upload

I am trying to create a website using PHP that is going to allow customers to upload many pictures. However, I only need the pictures that the customers are uploading to be very small in size. The problem is that most of the time they are going to be uploading files that are much higher quality than I need. I want to save bandwidth by somehow telling the server only to upload a php file to be a certain size, rather then uploading the whole thing. Is this something that is possible? Or am I going to be waisting more bandwidth then i save by shrinking the photos.

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@SheldonDec 01.2005 — google image magic
Copy linkTweet thisAlerts:
@rbailerauthorDec 01.2005 — I did a little research on the GD Image library and it looks like that is just used to create images on the fly. Maybe that is only one of the uses, and i can utilize it for my needs, but I can't figure out how to use the program to do what i want. I will try to explain my problem a bit more.

On my site, each customer is going to upload about 100 photos from their photo library. I am then going to use those photos to create a piece of artwork for them. However, I only need the photos to be a fraction of the size that the customers are going to be uploading them as. My problem is that I am trying to save bandwidth by uploading a 100kb file instead of a 2mb file.

What I am thinking is that there is no way for PHP to do this because it is a server side code. In other words it is going to have to have the whole 2mb file uploaded to the server, before it can reduce it to 100kb, hence defeating the whole purpose of saving the bandwidth during upload.

So my inclination is that my website has to somehow have a program that downloads onto the customer's computer and reduces the image size on the customers computer before uploading.

SOMONE PLEASE TELL ME THAT I AM TOTALLY WRONG.
Copy linkTweet thisAlerts:
@bokehDec 01.2005 — Unfortunately there is no way to limit the max file size until after the whole file has arrived to the server. Although the max file size can be specified in the html form and also in php defaults these settings have no effect until after the file arrives at the server when if it is over size it will be deleted.
×

Success!

Help @rbailer spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...