Browsing a folder using browse option.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sreed
    New Member
    • Mar 2011
    • 1

    Browsing a folder using browse option.

    Hi,

    I need to have my user send the file path to the webserver. For this i'm trying to use input file type so that user can select the file. Please note that I don't want do uploading the file. I just need the location of some file. So user should be able to do that using browse option. I know that due to some security reasons in browsers, full path is not sent to server. But can we acheive this some way. I've observed that using input type=file after user selects some file using browse option (as it is not possible to select folder), the Firefox sends the server just the filename and IE sends fullpath of file including file name.

    Please note that this website is used internally so it is not a security problem at all, so don't bother about security and all.

    is there anyway we can acheive this?

    Thanks in advance,
    Sreed
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    This was removed from Mozilla/Firefox (it was present in earlier versions).

    What you'd need to do is look into specific browser solutions where security restrictions are relaxed allowing the browser to run privileged scripts. See, for example, this link for Firefox.

    Alternatively, for a much simpler solution, just get the user to paste the file location in a text box! Don't forget that even with the file input, they could browse to the wrong file.

    Comment

    Working...