/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Upload list of files from client directory

Anyone have a link or search term for a way to allow the user to upload a list of file names to a web form? I do not need the actual files, just the file names — name only or full path, doesn’t matter. I can live with either just pointing to a directory and grabbing every file name in it, or requiring the user to select all the desired files from within a directory list.

(My guess is that the JavaScript sandbox for a web form won’t allow this, but I figured I’d check with you experts before looking into other possibilities, e.g. Java applet, etc.)

I’m already using the JQuery library for some other stuff, in case there’s something I should be looking for there or one of its plug-ins.

Thanks.

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@rnd_meSep 10.2010 — the newest browsers allow muiltiple files to be selected via the dialog that pops-up using <input type="file">.

you can simply CTRL+A and press enter to grab all the files in a folder when the dialog comes up.

the files will then be listed in the input's .files property.

you should only expect the filename, not the full path.
Copy linkTweet thisAlerts:
@NogDogauthorSep 10.2010 — the newest browsers allow muiltiple files to be selected via the dialog that pops-up using <input type="file">.

you can simply CTRL+A and press enter to grab all the files in a folder when the dialog comes up.

the files will then be listed in the input's .files property.

you should only expect the filename, not the full path.[/QUOTE]


Hmm...not on any of my browsers (FF 3.6.9, IE8, Chrome). ?
Copy linkTweet thisAlerts:
@rnd_meSep 10.2010 — Hmm...not on any of my browsers (FF 3.6.9, IE8, Chrome). ?[/QUOTE]

try again, i know ff3.6 works : http://demos.hacks.mozilla.org/openweb/multipleFiles/
Copy linkTweet thisAlerts:
@FangSep 10.2010 — Works in Firefox, Chrome and Safari
Copy linkTweet thisAlerts:
@NogDogauthorSep 10.2010 — OK, it works, [I]if[/I] -- as nobody mentioned -- you add the "multiple" attribute to the input tag.
[code=php]
<form action='' method='post'>
<input type='file' name='file[]' multiple='multiple' />
<input type='submit' name='submit' />
</form>
<pre><?php
if(isset($_POST)) {
print_r($_POST);
}
?></pre>
[/code]
Copy linkTweet thisAlerts:
@FangSep 10.2010 — OK, it works, [I]if[/I] -- as nobody mentioned -- you add the "multiple" attribute to the input tag.[/QUOTE]Clearly explained in the code from Mozilla
Copy linkTweet thisAlerts:
@NogDogauthorSep 10.2010 — Clearly explained in the code from Mozilla[/QUOTE]

Yes it was, once "rnd me" pointed me to a link. ?
Copy linkTweet thisAlerts:
@rnd_meSep 10.2010 — OK, it works, [I]if[/I] -- as nobody mentioned -- you add the "multiple" attribute to the input tag.
[/QUOTE]


using google is a lot quicker than waiting on anonymous jerks.
×

Success!

Help @NogDog spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 10.12,
social: @webDeveloperHQ,
});

legal: ({
terms: of use,
privacy: policy
analytics: Fullres
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @aldoushuxley,
tipped: article
amount: 1000 SATS,

tipper: Anonymous,
tipped: article
amount: 1000 SATS,

tipper: @linalla,
tipped: article
amount: 1000 SATS,
)...