Home>

▼ What i am creating
File upload screen

▼ I'm in trouble
When you press the button on the file upload screen,
An error has occured. I couldn't find any meaning even if I googled the error, so I asked this question.
"jquery-3.3.1.min.js: 2 Uncaught DOMException: Failed to set the'value'property on'HTMLInputElement&apos ;: This input element accepts a filename, which may only be programmatically set to the empty string ."

Someone knows the same error or content
Professor

Appendix 1
The following code is where input is, but there is no value attribute.

<input type = "file" name = "file" accept = 'application/zip' required>
  • Answer # 1

      

    This input element accepts a filename, which may only be programmatically set to the empty string.

    The file name is set for this input element
    However, only empty strings can be set from the program (for security reasons)

    Are you saying

    ?
    In other words, isn't the value attribute of the input element somewhere in the program (type ="file") set a value?


    Eh? Why can't I change the value of the input element oftype = file?

    If there is an XSS vulnerability, can the uploaded file be changed to an arbitrary file by a script-like guy prepared by the attacker? Maybe that's not the case? I don't do it, but

    p

    I think I'm not calling it correctly
    It would be better to hit the source written by yourself

  • Answer # 2

    Original text ↓

      

    jquery-3.3.1.min.js: 2 Uncaught DOMException: Failed to set the'value'property on'HTMLInputElement&apos ;: This input element accepts a filename, which may only be programmatically set to the empty string.

    Results of Google translation ↓

      

    jquery-3.3.1.min.js: 2 Uncaught DOMException: Setting'value'property of'HTMLInputElement'failed: This input element receives the file name. This file name can only be set to an empty string by the program.

    Do you understand the meaning?


    The value may have been set by JavaScript.
    It's just speculation because there is no source.
    $('# file-upload-filearea'). val ('some value');