locked
Get folder location from file upload control RRS feed

  • Question

  • User237591224 posted

    I need to get the file/folder location of the file a user is uploading. I know about the security aspect, but I am working on an application that resides within our intranet. The name of the folder the file resides in is something I need to collect. Is there a way to get it? I've tried some javascript, and while it works locally, when I deploy it to the web server I just get the fakepath location. Is there a way to get it? Thanks.

    Tuesday, February 27, 2018 9:26 PM

Answers

  • User283571144 posted

    Hi tbowen01,

    I need to get the file/folder location of the file a user is uploading. I know about the security aspect, but I am working on an application that resides within our intranet. The name of the folder the file resides in is something I need to collect. Is there a way to get it? I've tried some javascript, and while it works locally, when I deploy it to the web server I just get the fakepath location. Is there a way to get it? Thanks.

    As you say, modern browser will not tell you the path on the client, for security reasons.

    So we couldn't get the full path in the client-side.

    Just to mention - IE provides full client-side file path with old version.

    If you still want to get the client-side path, I suggest you could choose ie and use F12 develop tool with emulation to test the javascript codes.

    Besides, there is also an IE option under:

    • Internet Options
    • Security tab
    • In "Internet" or "Intranet" click on Custom Level
    • In the Security Settings scroll down until you see “Include local directory path when uploading files to a server” and disable it.
    • Click OK on Internet Options window and refresh.

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 28, 2018 2:06 AM

All replies

  • User283571144 posted

    Hi tbowen01,

    I need to get the file/folder location of the file a user is uploading. I know about the security aspect, but I am working on an application that resides within our intranet. The name of the folder the file resides in is something I need to collect. Is there a way to get it? I've tried some javascript, and while it works locally, when I deploy it to the web server I just get the fakepath location. Is there a way to get it? Thanks.

    As you say, modern browser will not tell you the path on the client, for security reasons.

    So we couldn't get the full path in the client-side.

    Just to mention - IE provides full client-side file path with old version.

    If you still want to get the client-side path, I suggest you could choose ie and use F12 develop tool with emulation to test the javascript codes.

    Besides, there is also an IE option under:

    • Internet Options
    • Security tab
    • In "Internet" or "Intranet" click on Custom Level
    • In the Security Settings scroll down until you see “Include local directory path when uploading files to a server” and disable it.
    • Click OK on Internet Options window and refresh.

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 28, 2018 2:06 AM
  • User237591224 posted

    Thank you. Changing the settings in IE got me what I was looking for.

    Wednesday, February 28, 2018 3:53 PM