Re: [PHP] Upload File Path Problem

2001-10-05 Thread root

$imagefile contains the name of the file in the temp dir. So the name is some 
mess like phpx . If you want the file you do copy() or something other. 
After the script is done the file is deleted. I prefer using $HTTP_POST_VARS
do var_dump($HTTP_POST_VARS) to see debug info.

Andrey Hristov
IcyGEN Corporation
Building Solutions
http://www.icygen.com

On Friday 05 October 2001 18:41, you wrote:
> All,
>
> I am putting together a simple upload program where an
> HTML form calls a php script passing a file which is
> then used to upload. I am running this locally
> currently, prior to rolling out to a test server.
>
> My problem is this. The variable $filename I am
> passing from the form to the php script is having the
> path corrupted. In the php script if I echo
> $filename_name the file name is being passed correctly
> (test.txt) but when I echo the $filename variable it
> contains a value of \\php2 when infact the correct
> value should be c:\test.txt.
>
>
> I include below my sample code. If anyone has any
> ideas I would be most grateful.
>
> Thanks in advance,
>
>
> Roger
>
> upload.html
> ==
>
> 
>
>  ACTION = "uploadrjb.php3" >
> 
> Upload file   :  NAME="userfile">
> Image Description :  NAME="description" SIZE=40 align="left">
> First Name:  SIZE=30 align="left">  Last Name:  NAME="lastname" SIZE=30 align="left">
> Location  : 
> Dagenham
> Romford
> Other 
> Age   :  ALIGN="right">
> Email Address :  SIZE=30 ALIGN="left">
> 
> 
> 
>
> 
>
> uploadrjb.php3
> ==
> 
> //echo $userfile; 
>
> echo "File=" . "$userfile";
>   echo "File=" . $userfile_name;
>
> //echo "Description=" . $description;
> //echo "Age= " . $age;
> //echo "First Name = " . $firstname;
> //echo "Last Name = " . $lastname;
> //echo "Location = ". $location;
> //echo "Email = ". $email;
>
> if ( isset($userfile)  ) {
>   if ( copy("c:\\" . "$userfile_name",
> "c:\\bollocks.txt") ) {
>   echo("File Successfully copied");
>   } else {
>   echo("Error: Failed to copy file...");
>   }
> }
> ?>
>
>
>
>
>
>
> __
> Do You Yahoo!?
> NEW from Yahoo! GeoCities - quick and easy web site hosting, just
> $8.95/month. http://geocities.yahoo.com/ps/info1

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Upload File Path Problem

2001-10-05 Thread Roger Bryant

All,

I am putting together a simple upload program where an
HTML form calls a php script passing a file which is
then used to upload. I am running this locally
currently, prior to rolling out to a test server.

My problem is this. The variable $filename I am
passing from the form to the php script is having the
path corrupted. In the php script if I echo
$filename_name the file name is being passed correctly
(test.txt) but when I echo the $filename variable it
contains a value of \\php2 when infact the correct
value should be c:\test.txt. 


I include below my sample code. If anyone has any
ideas I would be most grateful.

Thanks in advance,


Roger

upload.html
==




 
Upload file : 
Image Description   : 
First Name  :   Last Name: 
Location:  
Dagenham
Romford
Other 
Age : 
Email Address   : 






uploadrjb.php3
==


echo "File=" . "$userfile"; 
  echo "File=" . $userfile_name; 

//echo "Description=" . $description; 
//echo "Age= " . $age; 
//echo "First Name = " . $firstname; 
//echo "Last Name = " . $lastname;
//echo "Location = ". $location; 
//echo "Email = ". $email; 

if ( isset($userfile)  ) {
if ( copy("c:\\" . "$userfile_name",
"c:\\bollocks.txt") ) {
echo("File Successfully copied");
} else {
echo("Error: Failed to copy file...");
}
}
?>






__
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]