file_name
| From: | Saci | Date: | Sun, 28 Jul 2002 09:20:28 +0000 |
| Subject: | file_name | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-110040@lists.php.net to get a copy of this message | ||
I'm using php 4.21 on WIN xp.
I 'm trying to work with file upload, I already read several sites who
refer that php will set the variable file_name automaticly,.
I made 2 tries one on line 6 and other on line 7 of the atached code, but
both does not work.
Why I receive the folowing errors, and how can I correct
Notice: Undefined index: file_name in
d:\inetpub\wwwroot\impac\php\upfile.php on line 6
Successfully uploaded
Notice: Undefined variable: file_name in
d:\inetpub\wwwroot\impac\php\upfile.php on line 7
<HTML>
<BODY>
<?php
if (isset($_POST['file'])){
echo "Successfully uploaded ",$_POST['file'], "<BR>\n";
echo "Successfully uploaded ",$_POST['file_name'], "<BR>\n";
echo "Successfully uploaded ",$file_name, "<BR>\n";
}
else
echo "unccessfully uploaded ", "<BR>\n";
phpinfo();
?>
<FORM METHOD=POST ACTION=upfile.php enctype='multipart/form-data'>
<input type=hidden name='MAX_FILE_SIZE' value=200000>
<INPUT TYPE=FILE NAME=file><BR>
<INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>