RE: [PHP] File upload problem
| From: | Chris McCluskey | Date: | Tue, 18 Feb 2003 17:41:31 +0000 |
| Subject: | RE: [PHP] File upload problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-136043@lists.php.net to get a copy of this message | ||
Try
if(isset($_REQUEST["Submit"]))
If that doesn't work, perhaps you could just diagnose this by
print_r'ing the variables you are getting from the form:
(at the very top of your code, put):
die(print_r($_REQUEST));
-Chris
-----Original Message-----
From: Manuel Ochoa [mailto:manuel@ochoa-usa.com]
Sent: Tuesday, February 18, 2003 7:04 AM
To: John M; php-general@lists.php.net
Subject: Re: [PHP] File upload problem
There may be several reasons why it doesn't work but the first thing I
noticed is that "action" is blank. You need to have this defined.
John M <bali1a@freemail.hu> wrote:Hello,
I have the code below. It's a simple file upload. But it doesn't work.
Before the line if(isset( $Submit )) is an echo which can I read. But
after
choosing a file and press a submit nothing happens. Why is if(isset(
$Submit )) always false? Maybe my apache or php config is wrong?
I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on ,
upload_tmp_dir
is "c:\tmp\" and upload_max_filesize is 2M in PHP config file.
Thanks!
[input]
[input]
echo "Before submit
\n";
if(isset( $Submit ))
{
echo "After submit
\n";
if ($_FILES['imagefile']['type'] == "image/gif"){
copy ($_FILES['imagefile']['tmp_name'],
"files/".$_FILES['imagefile']['name'])
or die ("Could not copy");
echo "Name: ".$_FILES['imagefile']['name']."";
}
else {
echo "";
echo "Could Not Copy, Wrong Filetype
(".$_FILES['imagefile']['name'].")";
}
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
~ Manuel Ochoa ~
Seven days is too long to wait for a gun!