Jump to content

upload file name edit


Recommended Posts

when you upload something it will save here:

 

"upload/filename.ipa"

 

but i want it so there is a submit field (i think) that will allow you to type in a name for it, eg.

 

the file is called "blah" but you type in the form "game" then it changes it to:

 

"upload/game.ipa"

 

with the .ipa being default.

 

Script

    <?php
$path1= "upload/".$HTTP_POST_FILES['ufile']['name'][0];
copy($HTTP_POST_FILES['ufile']['tmp_name'][0], $path1);

echo " Download Link, http://teambrod.110mb.com/upload/".$HTTP_POST_FILES['ufile']['name'][0]."<BR/>";

$filesize1=$HTTP_POST_FILES['ufile']['size'][0];
if($filesize1 != 0)
{
echo "Upload Complete";
}
?>

 

Link to comment
https://forums.phpfreaks.com/topic/157530-upload-file-name-edit/
Share on other sites

Just so I'm clear, the user is inputting a file, but you want them to rename it after they upload it?  Why wouldn't they just upload the correct file name?

 

Are you storing the url to the file in a database and then referencing the physically uploaded file stored in a local folder?

 

Check out this tutorial:

http://www.phpeasystep.com/phptu/18.html

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.