logo       

upload question: msg#00401

Subject: upload question
Greetings all,
Using PHP 4.1.1 / Apache Server / MS Win 98 / IE 5.5

The following script is from Julie Meloni's book PHP Fast and Easy on page
170-174.

The first part is an html form in which the user browses and chooses a file
to be upoloaded to the server.

The script works fine in that when I chose a file and hit submit it, the
file ends up in:

C:\apache\htdocs

However, in the book, in the last illustration, she explains:

"Just to be sure, use the File/Open Page menu item in your _browser_ to
navigate through your filesystem and find the file that you just uploaded."

The illustration shows the .jpg file _within_ the browser screen on the
upper left hand side.

When I follow those steps and hit file / open, my paint program takes over
and opens the uploaded .jpg file and the browser interface of MS IE 5.5 is
gone.

Any advice would be appreciated.
Thank you.

Tony Ritter
.......................................................................

// html form
</head>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
<p>
File to upload:
<input type="file" name="thefile" size="30">
</p>
<p>
<input type="submit" name="submit" value="Upload File">
</p>
</form>
</body>
</html>


// .php script called  upload.php
<?
if ($thefile != "")
 {
  copy("$thefile","C:\\apache\\htdocs\\$thefile_name")or die("Could not copy
the file.");
 }
else
 {
  echo "No file to upload.";
 }
?>
<html>
<head>
</head>
<body>
<p>
You sent:
<? echo "$thefile_name"; ?>, a <? echo "$thefile_size"; ?> byte file with a
mime type of <? echo "$thefile_type" ; ?>.
</p>
</body>
</html>






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




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe