Re: File Upload
| From: | Bogdan Stancescu | Date: | Sat, 14 Dec 2002 03:09:14 +0000 |
| Subject: | Re: File Upload | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128246@lists.php.net to get a copy of this message | ||
Globals on? File uploads allowed? Safe mode off?
Miro Kralovic wrote:
Hi everybody, I'm trying to upload a file using the following scripts, but it doesn't work, it actually doesn't get through the first line of PHP script at all and displays "a problem has occured" message. I'm running the script on RH Linux/PHP4. Is there anything I'm missing here??? Many thanks in advance, Miro. --------------------------------------------------------------------- [upload_file.html] <html> <head><title>File Upload</title></head> <body> <form id="data" method="post" action="input_file.php" enctype="multipart/form-data"> <p> Choose a file: <br> <input name="testfile" type="file" size="50" maxlength="100000"><br> <input name="submit" type="submit"> </p> </form> </body> </html> [input_file.php] <?phpif ($testfile) {if (is_uploaded_file($testfile)) {echo "userfile: $testfile<br>\n"; echo "userfile_name: $testfile_name<br>\n"; echo "userfile_size: $testfile_size<br>\n";} else {echo "no file updated";}} else {echo "a problem has occured";}?>