Reputation: 1170
How can i select a folder in browse button. I mean, i want to upload a folder or file. So is it possible?
Upvotes: 0
Views: 5578
Reputation: 2157
You can use <input name="myfile" type="file" />
in a form and $_FILES
in PHP to get the uploaded file.
I think Chrome 11+ also supports uploading folders, but there is no HTML-Only Solution that works for all browsers.
Edit: FancyUpload supports uploading multiple files. Maybe that is what you're looking for. :)
Upvotes: 0
Reputation: 943569
just tried html tag input with file type
That's all about HTML and has nothing to do with PHP (at least until the data is submitted).
HTML provides no mechanism to select folders for upload.
HTML 5 allows multiple files to be selected. I assume this would be handled in PHP the same way as any other kind of multiple value response would be handled - make sure the name ends in []
then treat it as an array in $_POST
.
Upvotes: 1
Reputation: 10469
As far as I'm aware this is only possible in chrome (and possibly only in a nightly build).
I could be wrong but googling things is just too much effort
Upvotes: 0