I\'m trying to rename a file I\'m uploading.
I will be uploading a xml or pdf file, and I want it to be in a folder called \"files/orderid/\" and the filen
Thanks guy, it all helped.
My solution was to make a variable with the extension, and then use that through out the file.
//Check file extension
$path = $_FILES["fileToUpload"]["name"];
$ext = pathinfo($path, PATHINFO_EXTENSION);
and then
move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], "files/$id/$id.$ext"