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
You set the target file to be the name of the file. You should be setting a different name.
Try this:
$target_dir = "files/$id/"; $uploadOk = 1; $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); $target_file = "{$target_dir}{$id}.{$imageFileType};