Multiple File Input

Submit beberapa file menggunakan attribut multiple pada tag input. Support Firefox 3.6+ dan WebKit browser. Tempatkan “multiple files” pada folder yang sama.

HTML

<form method="post" action="upload.php" enctype="multipart/form-data">
  <input name='uploads[]' type="file" multiple>
  <input type="submit" value="Send">
</form>

PHP

foreach ($_FILES['uploads']['name'] as $filename) {
    echo '
	<li>' . $filename . '</li>
';
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s