cvs: phpdoc /en/features file-upload.xml
| From: | Derick Rethans | Date: | Wed, 11 Jun 2003 21:13:58 +0000 |
| Subject: | cvs: phpdoc /en/features file-upload.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969354416@lists.php.net to get a copy of this message | ||
derick Wed Jun 11 17:13:58 2003 EDT
Modified files:
/phpdoc/en/features file-upload.xml
Log:
- Layout fixes (the lines were waaay too long)
Index: phpdoc/en/features/file-upload.xml
diff -u phpdoc/en/features/file-upload.xml:1.60 phpdoc/en/features/file-upload.xml:1.61
--- phpdoc/en/features/file-upload.xml:1.60 Thu Jun 5 23:56:11 2003
+++ phpdoc/en/features/file-upload.xml Wed Jun 11 17:13:57 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.60 $ -->
+<!-- $Revision: 1.61 $ -->
<chapter id="features.file-upload">
<title>Handling file uploads</title>
@@ -176,14 +176,17 @@
<programlisting role="php">
<![CDATA[
<?php
-// In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of $_FILES.
-// In PHP earlier then 4.0.3, use copy() and is_uploaded_file() instead of move_uploaded_file
+// In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of
+// $_FILES. In PHP earlier then 4.0.3, use copy() and is_uploaded_file()
+// instead of move_uploaded_file
$uploaddir = '/var/www/uploads/';
+$uploadfile = $uploaddir. $_FILES['userfile']['name'];
print "<pre>";
-if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir .
$_FILES['userfile']['name'])) {
- print "File is valid, and was successfully uploaded. Here's some more debugging
info:\n";
+if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
+ print "File is valid, and was successfully uploaded. ";
+ print "Here's some more debugging info:\n";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";