Jump to content

upload before resizing image?


jwk811

Recommended Posts

i find it easier to use move_uploaded_file() and then resize the image that now exists in the folder than to get the temporary image and use the other functions that have been messing me up. my question is, is it going to take longer to upload and resize and delete original or is there a simple way to resize before uploading. if it should be okay how do i delete the image when im done?

Link to comment
Share on other sites

It is my understanding that you have to upload the file before you can manipulate it.  Perhaps, though, you could manipulate the temp file stored on the server (I don't know if this is possible-just a though)...but if you're still manipulating a file on the server, I don't know if it would truly make a difference to do it before or after uploading.

Link to comment
Share on other sites

being server-side, php manipulates AFTER the image hits the server. There are scripts that will resize at the time the file is first uploaded before it is saved.  And ones that will resize after you have saved it. I doubt that the time differential will be significant.

 

To resize BEFORE it is uploaded would require javascript

Link to comment
Share on other sites

Yes it is automatically uploaded to a folder on the server as a temp file.  (I worded it incorrectly before...I believe it is always the same folder.)  Once the script that is called by `action` in the form is done running, the file is deleted.

Link to comment
Share on other sites

The temp file information can be found in the $_FILES array.

 

I am really having trouble understanding, though, why you HAVE to resize the temp image before moving it to a different place on the server.  Common convention is to upload (i.e. move it from the temp folder) and then manipulate the image...why not go with common convention?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.