Monday, May 13, 2013

How to upload files using PHP?


Files can be uploaded in PHP by using the tag type=”file”. An upload form must have encytype="multipart/form-data" , method also needs to be set to method="post". Also, hidden input MAX_FILE_SIZE before the file input. To restrict the size of files
E.g.
<form enctype="multipart/form-data" action="sampleuplaod.php"
method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="1000" />

1 comment: