Uploading Image Files

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 6
Joined: Tue Nov 26, 2002 1:40 pm

Thu Dec 05, 2002 10:47 am

I'm using a form to upload image files from the users computer to a web server. I'm a little confuse though. I believe I can use the copy function but I dont not know what I need to put in the destination path name. For example...

Let's just say my webspace server is http://www.Grigory.com

In the destination path name would I put "www.grigory.com/$image"???
or put "http://www.grigory.com/$image"
or maybe "ftp://www.grigory.com/$image"

If you were to just use say "images/$image" would that upload it from the directory that this php script is in?

I hope someone can shed some light on this for me
If my calculations are correct, you're about to see some serious shit.

Dmitrit Plakhotnik
New php-forum User
New php-forum User
Posts: 13
Joined: Fri Nov 01, 2002 6:56 am

Fri Dec 06, 2002 3:43 am

For upload images or other you must:

create upload form
<form method=post action='upload.php' ENCTYPE='multipart/form-data' >
<input type='file' name=uptmp value='UPLOAD'>
<input type='submit' name='submitButtonName' value='SAVE'>

after in upload.php use $uptmp for get place where server copy data
and copy it where you need

$uptmp - path and filename on server
$uptmp_name - original filename
copy($uptmp, "images/".$uptmp_name);
Dmitriy S. Plakhotnik
AlarIT programmer

Post Reply