You are here: Re: Help with rename and unlink script please « PHP Programming Language « IT news, forums, messages
Re: Help with rename and unlink script please

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация