Jquery input.files equivalent

前端 未结 4 759
一向
一向 2020-12-09 16:46

I have a simple html form with a single file upload input. (jsfiddle)

In the past, I have accessed the file selected by the user using input.files, howe

4条回答
  •  不思量自难忘°
    2020-12-09 17:17

    jQuery doesn't provide a wrapper for the Files API. So there isn't a jQuery style way to do this, at least not built into the jQuery core.

    Your options:

    • stick with option A
    • wait for jQuery to include such a wrapper (they might not)
    • find an extension written by someone else (if one exists)
    • write an extension yourself

提交回复
热议问题