To all, The following is a file upload question using PHP. I am able to upload a file to my server with the following script. (see below)
It's in two parts - the first is a html form and the second is the php script which takes the variable $img1_name. However, I'd like to check if, in fact, the file was uploaded to the server. The only way I can check this is to copy and paste the pathname that I upoloaded in the browser's window like: c:/Program Files/Apache Group/Apache/htdocs/reservoirphoto.jpg When I do that the photo does load - however it loads in a paint program I use like PaintShopPro - not as a file within the browser. The question is this...in the textbook I'm reading (Julie Meloni - PHP Fast and Easy - page 174), it says that: "(I can) use the File / Open Page / menu item in your web browser to navigate through your filesystem and find the file you uploaded." The screenshot in the book has the .jpg file photo *within* the browser screen - not by itself in a paint program. Can anybody assist me in this? Thanking all in advance. Tony Ritter ............................................................................ .......................... file://Script 1 - upload_form.html <HTML> <HEAD> <TITLE>Upload a File</TITLE> </HEAD> <BODY> <H1>Upload a File</H1> <FORM METHOD="post" ACTION="do_upload.php" ENCTYPE="multipart/form-data"> <p><strong>File to Upload:</strong><br> <INPUT TYPE="file" NAME="img1" SIZE="30"></p> <P><INPUT TYPE="submit" NAME="submit" VALUE="Upload File"></p> </FORM> </BODY> </HTML> ................................... file://Script 2 - do_upload.php <? if ($img1_name != "") { copy("$img1", "c:/Program Files/Apache Group/Apache/htdocs/$img1_name") or die("Couldn't copy the file."); } else { die("No input file specified"); } ?> <HTML> <HEAD> <TITLE>Successful File Upload</TITLE> </HEAD> <BODY> <H1>Success!</H1> <P>You sent: <? echo "$img1_name"; ?>, a <? echo "$img1_size"; ?> byte file with a mime type of <? echo "$img1_type"; ?>.</P> </BODY> </HTML> ........................ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]