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";
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php