Hi there all,
I am doing a small userupload script. All the users on my site shall be able to upload anyfiles they want to a specified directory, and the files shall be named "Username-originalfilename.ext", where username is the users username, originalfilename is the filename on the users computer, and ext is the file-extension on the users computer.
I want it to be possible for the user to upload ANY filetype he wants to.
I manage to do all the file uploads (via the php-ftp functios, cos I upload the files to another server then the php server.). But I dont manage to get the right filename.
The useruploadform looks like this;
<form name="uplink" ENCTYPE="multipart/form-data" action="/ankan/integrated/upload_user_files.php"
method="post">
<INPUT NAME="the_file" TYPE="file" SIZE="25">
<input type="Submit" Value="Upload" name="submit_ftpUserUpload">
</form>
So far everything is good. But when I write out the $the_file variable later on (actually earlier on in the script, cos it re-loads it self), I get a value something like
/tmp/phpbG0jyi
And hence the file name on the ftp-server gets the syntax "username-[random stuff], which is not what I desired.
Does anyone have a clue on how to save the file-name of the file that is uploaded, including the extension (.jpg,.mpg or whatever), so that I can use that in the uploaded files name?
Cheers,
anders österling