locked
Get file path from input type file RRS feed

  • Question

  • User-1826049516 posted

    Hi,

    I know security in browser prevents this out of the box, so what are my options. What I need are the file name (without path), file name (with path), size, modified, type. I then want to insert this data from the file input into a SQL database (formatting the path to url based rather than actual path).

    Take a sample file chosen from R:\Documents\Doc1.docx. In this case R: is a drive mapping to our file server, which is separate from the web server.

    Name | Size | Type | Modified | Url
    Doc1.docx | 143273 | application/vnd.openxmlformats-officedocument.wordprocessingml.document | 2018-11-26 14:05:49 | https://websitename/Documents/Doc1.docx

    I need it like this because we don't want a true upload. We want a pointer to the actual file that is used as a hyperlink.

    Thanks

    Monday, November 26, 2018 2:13 PM

All replies

  • User475983607 posted

    Hi,

    I know security in browser prevents this out of the box, so what are my options. What I need are the file name (without path), file name (with path), size, modified, type. I then want to insert this data from the file input into a SQL database (formatting the path to url based rather than actual path).

    Take a sample file chosen from R:\Documents\Doc1.docx. In this case R: is a drive mapping to our file server, which is separate from the web server.

    Name | Size | Type | Modified | Url
    Doc1.docx | 143273 | application/vnd.openxmlformats-officedocument.wordprocessingml.document | 2018-11-26 14:05:49 | https://websitename/Documents/Doc1.docx

    I need it like this because we don't want a true upload. We want a pointer to the actual file that is used as a hyperlink.

    Thanks

    You'll need to write a desktop application and install the application on each user's machine.  Or talk with your system Admin as they might and probably do have a utility to map files on a user's machine.

    Monday, November 26, 2018 3:07 PM
  • User753101303 posted

    Hi,

    And the web server is allowed to access to those files (you'll have also to configure the same mapped drive(s) - which are hopefully the same for all users ? - for the account under which the web server runs).

    For now the first posisble thing I see would be to let users enter this kind of path in a textbox (rather than using in input type=file control).

    Depending on which browser is used, you could also configure them posisbly using en enterprise level policy so that it is allowed if not already (hpefully you can do that for your domain only ? I believe this is what IE does ie it works be default for sites in your domain and is disabled for servers in other domains).

    Monday, November 26, 2018 3:17 PM
  • User-474980206 posted

    you should have a web page that does a directory and returns links that can be used. this will keep the files consistent. 

    Monday, November 26, 2018 4:48 PM