[PHP-DB] Re: I want to upload

2003-01-30 Thread Geckodeep
Well its me again ,you can also check this thread i've posted to get some
more information:
 " Help/Advice/Suggestions need to Upload 9 images on one submit button. "

GD
"Quique Notelodigo" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I want to upload a image, from the client, to the server.
>
> I use PHP and MySQL and Apache in the server.
>
> ¿How can I do it?
>
> _
> Charla con tus amigos en línea mediante MSN Messenger:
> http://messenger.microsoft.com/es
>



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




[PHP-DB] Re: I want to upload

2003-01-30 Thread Geckodeep
Here are some articles I found on different forums while on uploading files
etc, these should give you a head start.

use the move_uploaded_file ( string filename, string destination)

-> the one below is great it explains it in a very simple manner:
How do I find the file I just uploaded to the webserver and load it?

No matter where the file is uploaded, php will store certain variables for
you containing information about the file.  The full path and filename are
located in the variable with the same name as your file form field.
Let's say you called your file upload field "Picture" and that your Apache
temp directory is /inetpub/tmp/.
In your script, the variable $Picture will contain "/inetpub/tmp/1002.tmp"
where 1002.tmp is the temporary name of the file uploaded.  The variable
$Picture_name will contain the origional file name.
Performing a copy ($Picture, "./images/" . $Picture_name); will put the
image, proper name and all, in the images directory under the script root.
If the security on the server will not allow you to use the copy command,
try the file commmands to create and write a new file: (fopen, fread,
fwrite).  If the server security will not allow that command either, try
putting the images into a blob or binary field in your database.

->Here is an example of a script i found from some  foroum :
$realname was uploaded successfuly to the upload directory";

print "";

copy($_FILES['userfile']['tmp_name'],
"/Library/WebServer/yourURL.com/upload_directory/".$realname);
} else {
echo "Possible file upload attack: filename
".$_FILES['userfile']['name'].".";
}
}

?>
Good luck with it, I my self is a newbie hope it helps you.


GD
"Quique Notelodigo" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I want to upload a image, from the client, to the server.
>
> I use PHP and MySQL and Apache in the server.
>
> ¿How can I do it?
>
> _
> Charla con tus amigos en línea mediante MSN Messenger:
> http://messenger.microsoft.com/es
>



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