SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
-
Jun 17, 2007, 10:50 #1
- Join Date
- Sep 2004
- Location
- Liverpool
- Posts
- 38
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
How do I upload two versions of the same file
Hi,
I've looked for ages for an answer to this, hopefully someone can help me out.
I need to upload a jpg and place two versions of the file into a directory
(1st reduced in size, 2nd reduced further in size (i.e. thumbnail))
The problem I have is that I can reduce and copy the first version using move_uploaded_file(), however, I can't access the image again as it's been uploaded, is it possible to save a copy of the image for a second resize and upload ?
Any help appreciated.
AndyI was angered, for I had no shoes,
then I met a man who had no feet.
-
Jun 17, 2007, 12:36 #2
- Join Date
- Aug 2004
- Location
- Manchester UK
- Posts
- 13,807
- Mentioned
- 158 Post(s)
- Tagged
- 3 Thread(s)
Hi Andy, one method is to have the upload complete and the file is on the server then make a copy of it using copy().
So upload your big file and then make a smaller copy of itMike Swiffin - Community Team Advisor
Only a woman can read between the lines of a one word answer.....
-
Jun 17, 2007, 13:51 #3
- Join Date
- Sep 2004
- Location
- Liverpool
- Posts
- 38
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi Spike,
Does that mean there is a copy function which allows a resize also ?I was angered, for I had no shoes,
then I met a man who had no feet.
-
Jun 17, 2007, 14:20 #4
- Join Date
- Aug 2004
- Location
- Manchester UK
- Posts
- 13,807
- Mentioned
- 158 Post(s)
- Tagged
- 3 Thread(s)
No, you would use copy in conjunction with an image manipulation script to create the thumbnail. Something like imagejpeg or one of the other imagecreate functions.
Have a look through the user notes for functions.Mike Swiffin - Community Team Advisor
Only a woman can read between the lines of a one word answer.....
-
Jun 17, 2007, 19:25 #5
- Join Date
- Mar 2006
- Location
- Gold Coast, Australia
- Posts
- 1,369
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I did the same thing recently, following this method:
1. upload the large image, move and resize to a max width
2. using the resized large image, create the thumbnail to a max width
There is no need to use the temp file twice.Studiotime - Time Management for Web Developers
to-do's, messages, invoicing, reporting - 30 day free trial!
Thomas Multimedia Web Development
-
Jun 19, 2007, 10:43 #6
- Join Date
- Sep 2004
- Location
- Liverpool
- Posts
- 38
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks for the responses, I'll look into and let people know how I got on for future reference.
I was angered, for I had no shoes,
then I met a man who had no feet.
Bookmarks