File upload issues

Posted on 16th Feb 2014 by admin

Hi Guys,

Can anyone see any issues with this code:
Code: $setImage= 'productimages/' . date(U) . $HTTP_POST_FILES['setImage']['name'][0];
copy($HTTP_POST_FILES['setImage']['tmp_name'][0], $setImage);
Its stripping the original file name (including the extension) fromt he end of the image and just giving it a unix timestamp for a name. Looking at the code I think I can see why its doing that but I can't see how to fix it.

Any help would be most appreciated

Other forums