0

I just want to write html for a browsing button by which I can only select the location of a particular folder or drive i.e. c:\abc\def.

However, I tried <input type=file /> but it is not I want but in same way.

Strictly, I just want only the folder path and after selecting it,I need to write it in a textbox. I think it can be done the same way as <input type=file /> but for the folders.

And also I don't wanna use JPanals (swing/applets).

Any idea on this? Please help.

Thanks in advance.

Moksh
  • 185
  • 1
  • 6
  • 16

2 Answers2

1

Is not posible to get a path of the file via web for security reasons.

Rolando Corratge Nieves
  • 1,233
  • 2
  • 10
  • 25
  • How can I get it in intranet level (on local server)? – Moksh Jul 10 '12 at 14:32
  • @Moksh - You can't. Internets are webs. File inputs are designed to provide access to files, not information about the user's file system. – Quentin Jul 10 '12 at 14:33
  • I've tried this: http://stackoverflow.com/questions/1676070/input-type-file-ie-gives-full-path-ff-gives-only-filename-or-directory-bro – Moksh Jul 10 '12 at 15:52
0

I am afraid you cant do that.

There is an "accept" attribute on file input controls, you can apply any filters via that. However, this accept is ignored by many browsers, the mime type of the files work. I am not sure if there is a universal mime-type for folders.

i.e.

<input type="file" accept="image/*" />

that should show you a list of images only in any directory. This is not an answer, but a suggestion that may help you look further into it.

You may be able to put something together using Java or Flash (e.g. using SWFUpload as a basis).

Waqas Memon
  • 1,247
  • 9
  • 22
  • Thanks. As far as I searched, I found no but I managed to select any file on particular location and from that I captured the path. I know it is irritating but not blocking the funtionality. – Moksh Oct 20 '13 at 20:04