You are doing wrong... you are checking for the temp file and after that you
are deleting the temp file, you should copy the files first
This is your code
if(isset($UploadedFile))
{
unlink($UploadedFile); // Here you are deleting the temp file
print("Local File: $UploadedFile <BR>\n");
print("Name: $UploadedFile_name <BR>\n");
print("Size: $UploadedFile_size <BR>\n");
print("Type: $UploadedFile_type <BR>\n");
print("<HR>\n");
}
You should write something like this
if(isset($UploadedFile))
{
copy($UploadedFile, "/uploaded_files/" . $UploadedFile_name); // Here
we first copy the temp file to a secure path, you should change the
/uploaded_files/
// path
print("Local File: $UploadedFile <BR>\n");
print("Name: $UploadedFile_name <BR>\n");
print("Size: $UploadedFile_size <BR>\n");
print("Type: $UploadedFile_type <BR>\n");
print("<HR>\n");
unlink($UploadedFile); // Now we can delete the temp file
}
"Clemson Chan" <[EMAIL PROTECTED]> escribi� en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Thanks Juan, and other listers,
>
> I have this example,
>
> <HTML>
> <HEAD>
> <TITLE>Figure 7-3</TITLE>
> </HEAD>
> <BODY>
> <?
> //check for file upload
> if(isset($UploadedFile))
> {
> unlink($UploadedFile);
> print("Local File: $UploadedFile <BR>\n");
> print("Name: $UploadedFile_name <BR>\n");
> print("Size: $UploadedFile_size <BR>\n");
> print("Type: $UploadedFile_type <BR>\n");
> print("<HR>\n");
> }
> ?>
> <FORM ENCTYPE="multipart/form-data"
> ACTION="7-3.php" METHOD="post">
> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="4096000">
> <INPUT NAME="UploadedFile" TYPE="file">
> <INPUT TYPE="submit" VALUE="Upload">
> </FORM>
>
> </BODY>
> </HTML>
>
> and the result is this after I uploaded a file
>
> Local File: /tmp/phpnYLV2J
> Name: 323lake.jpg
> Size: 48254
> Type: image/pjpeg
>
> But I couldn't find the uploaded file, nor the /tmp/phpnYLV2J path.
> Do I normally do a copy after the upload?
> Can I just change the tmp path and filename when I upload?
> Thanks.
>
> --Clemson
>
>
>
> -----Original Message-----
> From: Juan Pablo Aqueveque [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 03, 2002 7:58 AM
> To: Clemson Chan; [EMAIL PROTECTED]
> Subject: Re: [PHP] Uploading file
>
>
> Hi friend,
>
> http://www.php.net/manual/en/features.file-upload.php
> And take a look to the User Contributed Notes
>
> --jp
>
> At 13:03 03-09-2002 -0700, Clemson Chan wrote:
> >Hi, I am new to this group.
> >I am trying to figure out how to let people to upload image files to my
> >website.
> >My ISP is using PHP 3 (I believe).
> >If someone can give me simple example, that will be great.
> >Thanks.
> >
> >--Clemson
> >
> >How can I tell what version of PHP is running on the system (linux)?
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
> ________________________________________________________
> Juan Pablo Aqueveque <[EMAIL PROTECTED]>
> Ingeniero de Sistemas
> Departamento de Redes y Comunicaciones http://www.drc.uct.cl
> Universidad Cat�lica de Temuco.
> Tel:(5645) 205 630 Fax:(5645) 205 628
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php