XUpload - Resize image before save?

Message
Author
Jens
Posts: 1
Joined: Sep 22, 2007 11:03 pm

Resize image before save?

#1 Postby Jens » Sep 22, 2007 11:18 pm

Hi.
I´m looking for a solution to handling the temporary file - after uploading and before saving - via Xupload. My plan is to use Xupload to show the progress of an original image upload and then make a resize and saving with an other php-file.

Is their any way a can skip the file saving event in the cgi-script or what is the easiest way to make this work?

I hope you understand what I´m trying to do. :)
/Jens

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#2 Postby PilgrimX182 » Sep 24, 2007 8:14 am

You wanna resize & save with PHP? What's the problem then? :D Just save file in upload1 folder, then XUpload send POST with file folder/name to your PHP script, then you resize and move to upload2 folder.

green
Posts: 1
Joined: Sep 22, 2008 4:44 pm

#3 Postby green » Sep 22, 2008 4:55 pm

Hmmm ...

I was looking for the same thing, and came across the post using search. Well, in most of the cases (in my case always) we resize & rename an image before uploading it when we work with php.

In this case, we are uploading this directly As admin has suggested in the above reply, we can always catch the file once it is uploaded, resize and rename this, upload this again, and finally delete the original file (in case we don't need to store the large file).

While this is technically possible, it also means doing the same thing twice, and the perl / cgi script is becoming valueless.

In case when we upload a video, again, normally we convert them to swf, catch a picture, etc. before uploading them finally to the server.

Ideally, thus, a good solution could be to do the manual work first, resizing / renaming / converting, etc. using our own scripting programs like php first, and then call the cgi script.

Wondering if this would be possible. However, the added issue here becomes the upload bar. Ideally, the upload bar that shows time elapsed and time remaining, should take into account those additional jobs as well, since renaming / resizing / converting etc are not client's problem really, they just need to see how long the total operation is taking.

Any thought, here?