Having trouble with file uploading
| From: | Serhat Artun [ Mlist ] | Date: | Fri, 13 Oct 2000 12:32:07 +0000 |
| Subject: | Having trouble with file uploading | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-19996@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
<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>
upload.php
<?
if (copy($userfile, "/tmp/")) {
echo("<B>File successfully copied!</B>");
} else {
echo("<B>Error: failed to copy file...</B>");
}
unlink($userfile);
?>