Forum Moderators: open

Message Too Old, No Replies

input type file multiple?

         

SpaceFrog

12:44 pm on Feb 15, 2005 (gmt 0)

10+ Year Member



Is there any way of getting close to an input type file allowing multiple file selection?

orion_rus

10:21 pm on Feb 15, 2005 (gmt 0)

10+ Year Member



U can add something like button "+"
and they add another field with input file tag)
If you agree we can show u how it makes

SpaceFrog

8:44 am on Feb 16, 2005 (gmt 0)

10+ Year Member



Well having a plus button or an input file button does not make a big difference does it?
You would still have to click each time on + to transfer file path to list ... (no problem for coding that).
I was actually thinking of a multiple select within the path browsing window.

orion_rus

9:39 am on Feb 16, 2005 (gmt 0)

10+ Year Member



But you need a common mechanizm which is make it) but i think it isn't( i didn't see anything like this( and think what is very hard to realize(
Sorry i can't help you here

SpaceFrog

10:16 am on Feb 16, 2005 (gmt 0)

10+ Year Member



I know it is rather complicated this is why I am scanning almost every single forum I know...

thanx anyway! :-)

orion_rus

1:05 pm on Feb 16, 2005 (gmt 0)

10+ Year Member



)) no problem) i think it should be common mechanism) i don't see any javascript what can do anything with filesystem, i think it's not secure) but may be you can find all what you want)
Good luck to you

SpaceFrog

2:34 pm on Feb 16, 2005 (gmt 0)

10+ Year Member



file managing is beyond javascript's sandpit ...
probably possible in vbscript but not wanted ...
I think I wil just have to stick with filling an array from multiple single selections then ;-)

Bernard Marx

2:53 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is for the web is it? (Just checking)

SpaceFrog

2:57 pm on Feb 16, 2005 (gmt 0)

10+ Year Member



Well actually it is just for personnal knowledge...
If it were for local application, I guess I could use some MS own special instructions...
But I was looking for something a bit more crossbrowser and online sort of multiple file selctor ...

Rambo Tribble

5:29 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Options lists can allow for multiple selections. JavaScript cannot read directories on or write to the local file system, but it can certainly access URLs.

Bernard Marx

5:33 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That one again, Rambo. If Javascript can access URLs in one host, it can read files in another. Technically, Javascript itself is deaf, dumb and blind.

I don't think there's a solution to the question of multiple file selection from a single use of a file chooser. With scripting, a file chooser could be used multiple times to feed filepaths to a hidden field, or multiple choosers could be used (like Geocities upload).

My (possibly unprogressive) thinking is that if there were a 'single use' solution, and it were reliable, then we would see it being used on the web. Does seem odd that it's not possible though.

Rambo Tribble

6:14 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Indeed, JavaScript does all its file handling through the browser and is thereby limited. JavaScript can initiate an HTTP request through the location object, and thereby access a file. JavaScript has no provision to access a file system, but it does have the tools to address a URL. The question resides in what you mean by selecting a file. Multiple filenames can be selected and processed. The file itself, if available as a URL, can be loaded in the browser. Selecting multiple files for a local file manipulation? No.

Bernard Marx

8:40 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Multiple filenames can be selected and processed

I guess that's all that's being asked for here. I've tried selecting multiple files with an <input type="file">, but no browser will let me select more than one file at a time, as a filechooser normally will.

(My disagreement about the other stuff is irrelevant here)

Rambo Tribble

10:00 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Okay, I see now. I apologize for the confusion, but I thought something else was the goal. Disregard my comments, as they were based on a faulty interpretation of the question.

SpaceFrog

7:54 am on Feb 17, 2005 (gmt 0)

10+ Year Member



Yes Bernard is right on what is actually asked here: how to select more than one file in one go as a normal file dialog box lets you do it, except when it is on line!
And in fact as pointed out I have never came accross this possibility on the web before... would this mean it is not feasable?
I think the main problem here is that yes js is blind directorywise.

Bernard Marx

8:39 am on Feb 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I sometimes use the fact that a feature doesn't appear on the Web as a pointer to the fact that it's not possible, or has minimal support, or is unreliable if it is possible. But where would we be if everyone thought like me?

I think the main problem here is that yes js is blind directorywise

That's not quite the point I was making.

From one perspective, one could consider core Javascript unable to do any of these things. It has no alerts or file choosers, and relies on its host's API for input and output of all kinds.

With security priveleges, Javascript (as JScript in IE/Win) can call on the ShellApplication object to launch a browse dialog that does allow multiple file selection. The standard IE API doesn't include a dialog with such a feature. Why?

SpaceFrog

10:47 am on Feb 17, 2005 (gmt 0)

10+ Year Member



Why is the real question ...
as I do not see any security failure in the possibility of selecting more than one file at a time ...? Well no more security failure than selecting just one file anyway ...

This can be done quite easily with vbscript fso and also for local applications... I was just investigating javascript's sandpit limits ... :-(

Bernard Marx

11:21 am on Feb 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



At risk of over-egging my pudding...

This can be done quite easily with vbscript fso

And equally with JScript/FSO. The pivotal factor is the methods provided by the FSO, not the scripting language (although VBScript does have native in/out dialogs).

- actually, the file chooser I was thinking of doesn't need FSO, rather the Shell.Application object, and it's browseForFolder method.

SpaceFrog

12:51 pm on Feb 17, 2005 (gmt 0)

10+ Year Member



thanx for the info ...
But that methid would not be suitable as it would require an ocx or specific dll...

Bernard Marx

2:11 pm on Feb 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That is true, but they come as standard with Windows installations of IE.

new ActiveXObject("Shell.Application").browseForFolder(0,'choose', 0x4000, 0);

That statement will open the dialog, with files visible, in IE/Win (once it is allowed security previleges).
It doesn't actually do anything else, as is.

All pointless though, 'cos I can't get that to select multiple ile either!

SpaceFrog

3:44 pm on Feb 17, 2005 (gmt 0)

10+ Year Member



such a weird thing that it cannot be done?

the dll comes as a standard with windows, but can it be called from moz or ffx?
what about linux ...?

Bernard Marx

4:29 pm on Feb 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Barking at The Moon, I think.

SpaceFrog

4:40 pm on Feb 17, 2005 (gmt 0)

10+ Year Member



LOL
lets just say this tread has had it ...

Thanks for your point of view, made things clearer for me