mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
- Layout fixes (the lines were waaay too long)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@131089 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
9022aee43a
commit
318c4adbdb
1 changed files with 8 additions and 5 deletions
|
@ -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 @@ Send this file: <input name="userfile" type="file">
|
|||
<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";
|
||||
|
|
Loading…
Reference in a new issue