Trouble with upload php
| From: | Serhat Artun | Date: | Fri, 13 Oct 2000 12:17:11 +0000 |
| Subject: | Trouble with upload php | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-19994@lists.php.net to get a copy of this message | ||
Hi list
I have tried a few file upload scrits but none of them work .. I have got a question about it . must
I put some variable to httpd.conf for it (Im using apache redhat.6.2 php4 )? I looked server log
file there was nothing about it when I press upload it is waiting for a while ( depends the
file's size ) and IE gives me DNS error .. if you have and idea please tell me
this is one of the script which I tried
index.html
<HTML>
<FORM ENCTYPE="multipart/form-data" ACTION="upload.php" METHOD=POST>
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000">
Send this file: <INPUT NAME="userfile" TYPE="file">
<INPUT TYPE="submit" VALUE="Send File">
</FORM>
</HTML>
upload.php
<HTML>
<!-- upload.php -->
You submitted this file:<BR><BR>
Name: <? echo($userfile); ?><BR>
Original Name: <? echo($userfile_name); ?><BR>
Size: <? echo($userfile_size); ?><BR>
Type: <? echo($userfile_type); ?><BR>
<?
// Copy the file to C:\upload.txt. Remember to escape backslashes!
if (copy($userfile, "C:\\upload.txt")) {
echo("<B>File successfully copied!</B>");
} else {
echo("<B>Error: failed to copy file...</B>");
}
// Destroy the file now we've copied it
unlink($userfile);
?>
</HTML>