Okay, I must be missing the totally obvious here...so if someone would be
able to help a poor newbie along the way I'd be most grateful.

The system I'm running this on is, in case it matters, WinXP with IIS 5.1 and
PHP 4.3.2.

Anyway, I'm trying to add a form to upload files on one of my pages. I only 
have one small problem, which is when my script is trying to move the uploaded 
file to its permanent place.

The relevant part of the script looks like this:

$uploaddir = 'C:\Inetpub\wwwroot\pix';
$filnamn=$_FILES['userfile']['name'];

if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir . 
$filnamn)) {
                print "File is valid, and was successfully uploaded.";
        } else {
                print "An error occured during upload.";
        }

Now, this works partly. It uploads the file. However, it doesn't end up in the
directory called pix as I want it to. No, what happens is that the
file gets named with pix as the first part of the filename. Like if the
file is called pic1.jpg it ends up as C:\Inetpub\wwwroot\pixpic1.jpg

I thought of just adding a backslash at the very end of the $uploaddir 
variable but that just leaves me with this error-message instead:

Parse error: parse error, unexpected T_STRING in 
c:\inetpub\wwwroot\alterdb\upload2.php on line 25

Line 25 happens to be that $filnamn line you can see above.

I'm at a loss as to what could be the problem so any suggestions to where to 
look?

Thanks in advance
-- 
/Jonas

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to