Przykład 18-1. File Upload Form
<form enctype="multipart/form-data" action="_URL_" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
<?php
// In php versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
print \"File is valid, and was successfully uploaded. \"; print \"Here's some more debugging info:n\"; } else {
print \"Possible file upload attack! Here's some debugging info:n\"; }
?>
manual sie klania