Re: Uploading Files

From: Date: Fri, 04 Oct 2002 22:29:56 +0000
Subject: Re: Uploading Files
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-118914@lists.php.net to get a copy of this message
"Jason" <jasonw@pacifier.com> disgorged: : <?php : move_uploaded_file($_FILES['userfile']['tmp_name'], : "../images/$_FILES['userfile']['name']"); : ?> : : I am able to get rid of this error, but changing the line to: : move_uploaded_file($_FILES['userfile']['tmp_name'], : "../images/$_FILES[userfile][name]"); : : However, the file is then uploaded as Array[name] : : How do I get past this? ==== I'm not 100% sure this will work, but try this: <?php $savetopath = "/path/to/your/upload/area" . $userfile; mode_uploaded_file($_FILES['userfile']['tmp_name'], $savetopath); ?> If you're using $_FILES, I assume you have Register_Globals = on? If not, use $HTTP_POST_FILES instead.. From 4.2.0 on register globals is off in the php.ini by default.. Also, you might try hotscripts.com for file upload scripts that allow one or multiple files at a time.. There may be a script there that's already created that'll serve your purpose.. http://www.hotscripts.com/PHP/Scripts_and_Programs/File_Manipulation/Upload_Sy stems/ HTH.. Take care.. peace.. eriol

« previous php.general (#118914) next »