search

Home  >  Q&A  >  body text

javascript - How to set the default image path for input[file] and prevent it from popping up a dialog box to select a file.

Now there is only one button to click submit to execute ajax, and then transfer the corresponding value to the server. Now there are problems with the image upload part:
1, if the default image path is not set through input[file], and Is there any way to directly submit the local image path to the server?
2. If it must be uploaded through input[file], how to set the local image path for it and prevent it from popping up the file selection pop-up box?

I hope the masters from all walks of life can give me some ideas. . .

某草草某草草2697 days ago1069

reply all(3)I'll reply

  • 仅有的幸福

    仅有的幸福2017-06-26 10:52:07

    There is no such function.
    It must pop up to let the user choose.

    If you can set the file path of input.file, wouldn’t it mean that you can upload files on the user’s machine at will?
    And the user doesn’t know it yet.

    reply
    0
  • 漂亮男人

    漂亮男人2017-06-26 10:52:07

    Everyone’s computer partition is different, and the location of the pictures must be different. How do you set the default local path?
    If you put these things in roughly the same place, you can give a small reminder next to it

    reply
    0
  • 滿天的星座

    滿天的星座2017-06-26 10:52:07

    The document says it is not allowed:

    http://www.w3school.com.cn/js...

    If allowed, the code writer will upload something privately beyond the user, causing damage to the user.

    reply
    0
  • Cancelreply