how to pass input type file data in ajax call

前端 未结 3 1345
死守一世寂寞
死守一世寂寞 2020-12-06 08:43

I\'ve my form

\" method=\"post\"> Photo <
3条回答
  •  难免孤独
    2020-12-06 09:16

    This is impossible.

    Sending data via an ajax call is not supported from browsers.

    The accepted workaround is to post the file in a hidden iframe in the background (so it looks like ajax). The solution here is to find your 'ajax file upload' library of choice and use that to upload the file.

提交回复
热议问题