|
Posted by Rik on 12/18/92 11:48
Dynamo wrote:
> Yes I'm sure. It is not move_uploaded_file that is causing the problem. It is
> the rename function that is causing the headache. To explain better, lets say
> I'm uploading a picture called mypicture.jpg. There is nothing in the uploaded
> filename that associates it with a record in a mysql table. So once the file has
> been uploaded I then rename it as 21.jpg by using
> rename('mypicture.jpg','21.jpg')
Why store it with the actual filename and rename it afterwards? You'll
have 2 files, one of which you aren't going to use... Or are you doing
something else with it?
$uploaddir = 'images/';
if (!move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir.
$_POST['imagefilename'])) {
echo "There was an error in your file upload. \n";
echo 'Here is some more debugging info:';
print_r($_FILES);
}
Navigation:
[Reply to this message]
|