Hi,
I have been manipulating image files after uploading in the usual way like moving the file from the /tmp folder to a preferred folder of the site.
Now i want to manipulate images by keeping them in the temp folder and once i have done with it then i want to move it to the preferred folder.
What i am trying to do is ...
- Showing a very simple custom file upload dialog.
- Select an image and click upload.
- The form is submitted to an iframe so i can show a progressing bar.
- The php script will echo the javascript code which will call a parent window function from the iframe to notify that the image has been uploaded.
- I wanted to show another dialog which will display the image from the tmp folder so that the user can resize and crop.
- When the user selects a region on the image to crop i will send the coordinates to the server and will manipulate the image in the tmp folder.
- When the image manipulation has been done i want the final image to be moved to my target folder.
here are my doubts.
- How long will the temp image be there in the tmp folder.
- How do i display the image in the temp folder in my dialog box because i only have its physical path.
- I think i can do it like
<img src='fetchfromtmp.php?filename>
. isn't it? and in the php script i can readfile the image like readfile('tmp/tmpfile').
So, finally, will manipulating from temp folder holds good?. will it be effective/suggestive?. What could be the complications? if any.
I would like to have suggestions and alternatives for my idea. Thank you.