locked
alternative to file upload control in asp.net RRS feed

  • Question

  • User1717218719 posted

    Hi,

    I am looking for an alternative to file upload control. I am coding in vb and I am looking to make my code less hardcoded and more efficient.

    the problem with file upload is I need to get the file path (which can change often). does anyone have any alternatives ?

    Thanks

    Erica

    Thursday, August 13, 2020 10:19 AM

Answers

  • User753101303 posted

    Hi,

    Usually it' just about using the input type="file" tag advanced capabilities. See https://developer.mozilla.org/en-US/docs/Web/API/File/Using_files_from_web_applications

    Do you mean using drag and drop rather than selecting a file? "the problem with file upload is I need to get the file path (which can change often)." is unclear. You just get the client side path for your information (the path being even sometime faked for safety reason and server side you are free to do whatever you want).

    if you mean uploading a file from a known path without uany user action this is not possible for safety reasons.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 13, 2020 11:16 AM

All replies

  • User475983607 posted

    E.RU

    the problem with file upload is I need to get the file path (which can change often). does anyone have any alternatives ?

    Your question indicates a design or understanding issue.  There is nothing you can do about the file path on the user's machine.  The file path on the server is typically well known.  Can you share the hard coded that is causing issues and explain your path requirements?

    Thursday, August 13, 2020 11:08 AM
  • User753101303 posted

    Hi,

    Usually it' just about using the input type="file" tag advanced capabilities. See https://developer.mozilla.org/en-US/docs/Web/API/File/Using_files_from_web_applications

    Do you mean using drag and drop rather than selecting a file? "the problem with file upload is I need to get the file path (which can change often)." is unclear. You just get the client side path for your information (the path being even sometime faked for safety reason and server side you are free to do whatever you want).

    if you mean uploading a file from a known path without uany user action this is not possible for safety reasons.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 13, 2020 11:16 AM
  • User-2138243527 posted

    Hi,

    Usually it' just about using the input type="file" tag advanced capabilities. See https://developer.mozilla.org/en-US/docs/Web/API/File/Using_files_from_web_applications

    Do you mean using drag and drop rather than selecting a file? "the problem with file upload is I need to get the file path (which can change often)." is unclear. You just get the client side path for your information (the path being even sometime faked for safety reason and server side you are free to do whatever you want).

    if you mean uploading a file from a known path without uany user action this is not possible for safety reasons.

    Your article is so useful for us,thanks for sharing. Good stuff!

    Monday, August 24, 2020 8:48 AM