3

i know this is a very basic question and i know i have done it before its just htta i cant seem to track the code or get the answer on the web... let me explain...

i am uploading a image

i want the original image in one dir and i want to create a thumbnail and tore that in another dir....i plan on using class.upload (verot.net)

i wanted to know if i can move_uploaded_file twice if not how do i do it..

andy
  • 175
  • 3
  • 13
  • Have you tried it? Why don't you *try* the approach you have outlined? If you encounter problems *then* come back and ask for help. – Lee Dec 16 '10 at 04:51

2 Answers2

4

Well, firstly use move_uploaded_file($tmp, $dest) and secondly copy($dest, $dest2)

Btw, your class should be able to save thumbnail by any path, different from the source image.

/me to the rescue ;-)

zerkms
  • 249,484
  • 69
  • 436
  • 539
1

If you want to make a copy of a file in a new location, use the copy() function: http://us2.php.net/manual/en/function.copy.php

This won't do anything to create a thumbnail, though; this will just duplicate the same file in two places. To create a thumbnail, you may consider using PHP's GD image processing functions: http://us2.php.net/manual/en/refs.utilspec.image.php

VoteyDisciple
  • 37,319
  • 5
  • 97
  • 97