Skip to content

Instantly share code, notes, and snippets.

@Ghostff
Created January 17, 2020 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ghostff/911cbf838c74da710efc58d5cb30d6af to your computer and use it in GitHub Desktop.
Save Ghostff/911cbf838c74da710efc58d5cb30d6af to your computer and use it in GitHub Desktop.
var_dump($_POST); // empty on reload.
if (isset($_POST['upload']))
{
$selected = $_FILES['files']['tmp_name'];
foreach ($selected as $tmp_name) {
var_dump($tmp_name);
}
}
else
{
echo <<< 'HTML'
<!DOCTYPE html>
<html>
<body>
<form method="post" enctype="multipart/form-data">
Select images: <input type="file" name="files[]" multiple>
<input type="submit" name="upload">
</form>
</body>
</html>
HTML;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment