/    Sign up×
Community /Pin to ProfileBookmark

directory selection not

Hi I developing an web application in which the user will select a multiple combination of files or directories on the local machine, and the paths of these directories/files get put into a text_area, but just the paths themselves get uploaded not the files. These then go on to be stored in a database.

Here lies my problem,
1 – I’ve found a piece of code which will insert the path into a text area on my web page, but its only IE specific I need it to work on multiple navigators.

2 – so far it can only select a file, I need it be able to select a directory, for logging purposes. Initially there won’t be a file in these directories for the user to select, so I can’t hack off the directory part of the string. Is there something around using javascript FileDialog()?

Can anyone Help please?

Thanks.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceFeb 17.2006 — 1) Anything that is allowing you to select a directoy path from the local drive is going to be specific to a particular browser. The reason is that the local drive is supposed to be off limits to anything running in a web page.

2) Selecting a file via the HTML FORM INPUT TYPE=FILE object is the only approved method for accessing the local drive. There is no such thing as a standard JavaScript FileDialog().
Copy linkTweet thisAlerts:
@fishman2001authorFeb 17.2006 — Thanks,

but I'm sure that somewhere someone must have developed a simple java script to do something similar.

Cheers.
Copy linkTweet thisAlerts:
@gphFeb 17.2006 — Thanks,

but I'm sure that somewhere someone must have developed a simple java script to do something similar.[/QUOTE]


No, xbrowser is impossible as phpnovice said. IE only and using ActiveX Shell.Application, WScript.Shell and Scripting.FileSystemObject to make it work properly. It's pointless online.
Copy linkTweet thisAlerts:
@phpnoviceFeb 17.2006 — Thanks,

but I'm sure that somewhere someone must have developed a simple java script to do something similar.[/QUOTE]

Sorry, but JavaScript just cannot do it -- in fact, is specifically designed to prevent that very thing. A browser plugin would be required to give each browser this ability. I've even heard there is an ActiveX plugin for Mozilla -- but I have no specific experience in that area.
×

Success!

Help @fishman2001 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 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...