svgmx5 Posted December 22, 2010 Share Posted December 22, 2010 Does anyone know how i can rename a PDF file name using PHP? What i have right now is a form where the user can upload a pdf file, however i want to be able to to rename the file and save it to the server. Link to comment https://forums.phpfreaks.com/topic/222364-how-can-i-use-php-to-rename-a-pdf-file-name/ Share on other sites More sharing options...
trq Posted December 22, 2010 Share Posted December 22, 2010 move_uploaded_file. Link to comment https://forums.phpfreaks.com/topic/222364-how-can-i-use-php-to-rename-a-pdf-file-name/#findComment-1150217 Share on other sites More sharing options...
bh Posted December 22, 2010 Share Posted December 22, 2010 If you upload a file, best use this function: move_uploaded_file() With this function you can easily rename the file, becouse you must add the file to the destination parameter. Link to comment https://forums.phpfreaks.com/topic/222364-how-can-i-use-php-to-rename-a-pdf-file-name/#findComment-1150218 Share on other sites More sharing options...
svgmx5 Posted December 22, 2010 Author Share Posted December 22, 2010 Thanks you guys, but i managed to figure it out after only 2 hours lol yea i used move_uploaded_file() and used the variable $target = $directory.$new_filename in which $new_filename = 'newpdf.pdf'; Thanks!! Link to comment https://forums.phpfreaks.com/topic/222364-how-can-i-use-php-to-rename-a-pdf-file-name/#findComment-1150220 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.