Last active
December 20, 2021 11:31
-
-
Save tararoutray/6d727151daf0fd2e7212bcbffc24381a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Check if the user has submitted the form. | |
*/ | |
if ($_SERVER['REQUEST_METHOD'] === 'POST') { | |
/** | |
* Print the $_FILES global variable. This will display the following: | |
* array(1) { | |
* ["myfiles"]=> array(6) { | |
* ["name"]=> array(2) { | |
* [0]=> string(9) "image.png" | |
* [1]=> string(9) "image.png" | |
* } | |
* ["full_path"]=> array(2) { | |
* [0]=> string(25) "folder1/folder2/image.png" | |
* [1]=> string(25) "folder3/folder4/image.png" | |
* } | |
* ["tmp_name"]=> array(2) { | |
* [0]=> string(14) "/tmp/phpV1J3EM" | |
* [1]=> string(14) "/tmp/phpzBmAkT" | |
* } | |
* // ... + error, type, size | |
* } | |
* } | |
*/ | |
var_dump($_FILES); | |
} | |
?> | |
<form action="" method="POST" enctype="multipart/form-data"> | |
<input name="myfiles[]" type="file" webkitdirectory multiple /> | |
<button type="submit">Submit</button> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment