I´m new to php and dont really know how to do this.. I have some code for a file upload: <?php //create the directory if doesn't exists (should have write permissons) if(!is_dir("./files")) mkdir("./files", 0755); //move the uploaded file move_uploaded_file($_FILES['Filedata']['tmp_name'], "./files/".$_FILES['Filedata']['name']); chmod("./files/".$_FILES['Filedata']['name'], 0777); ?> My question is how do I write some code that rename the uploade file to a specific new filename, and on which line should the code be? //thnx
replace: "./files/".$_FILES['Filedata']['name'] with: "./files/theFileNameYouWant.extension" like this for example: move_uploaded_file($_FILES['Filedata']['tmp_name'], "./files/myImage.png"); PHP: