Date: 10/31/02
- Next message: Rasmus Lerdorf: "Re: [PHP] str_replace"
- Previous message: PHP List: "Re: [PHP] How printing the name and value of a variable ?"
- In reply to: Edward Peloke: "[PHP] rename()"
- Next in thread: John W. Holmes: "RE: [PHP] rename()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
$_FILES['userfile']['name']
$_FILES['userfile']['type']
$_FILES['userfile']['size']
$_FILES['userfile']['tmp_name']
First once you upload file from browser using <form ...><input type=file
name=userfile>, the filename is automatically renamed by another one and put
down to the upload_tmp_dir and after you move or copy it into your
destination directory.
move_uploaded_file($_FILES['userfile'], string destination) or Copy(string
filename, string destination) rename automatically the picture name to
string destination, and you can set the destination's file extension using
$_FILES['userfile']['type'] or $_FILES['userfile']['name'] using php
function like eregi() for example-
----- Original Message -----
From: "Edward Peloke" <epeloke <email protected>>
To: <php-general <email protected>>
Sent: Friday, November 01, 2002 9:25 AM
Subject: [PHP] rename()
> I am trying to allow the user to upload pictures. What is the best way to
> rename them? If I use the rename function, I have to upload the pictures
to
> the same place as the script and then move it. ALso, if I am not sure of
> the extension, how can I simply rename it? Can I do multiple files at
once?
>
> Thanks,
> Eddie
>
>
> --
> 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
- Next message: Rasmus Lerdorf: "Re: [PHP] str_replace"
- Previous message: PHP List: "Re: [PHP] How printing the name and value of a variable ?"
- In reply to: Edward Peloke: "[PHP] rename()"
- Next in thread: John W. Holmes: "RE: [PHP] rename()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

