You are here: Re: PHP file upload form « PHP Programming Language « IT news, forums, messages
Re: PHP file upload form

Posted by Jacob Lyles on 12/18/92 11:49

I did this for the first time the other day.

On the HTML side:

<form enctype="multipart/form-data" action="/upload.php" method="POST"
>
Send this file: <input name="userfile" type="file" /> <br />
<input type="submit" value="Send File" />
</form>


And your PHP action:

$uploaddir = './dir/';
$file_name = $_FILES['userfile']['name'];
$uploadfile = $uploaddir . $file_name;
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile);


If you're buying third party hosting, sometimes they have a maximum
file size which you'll want to watch out for.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация