XMLHttpRequest POST multipart/form-data

后端 未结 7 1528
清酒与你
清酒与你 2020-12-04 20:33

I want to use XMLHttpRequest in JavaScript to POST a form that includes a file type input element so that I can avoid page refresh and get useful XML back.

I can sub

7条回答
  •  有刺的猬
    2020-12-04 20:40

    You will need to POST to an IFrame to get this to work, simply add a target attribute to your form, where you specify the IFrame ID. Something like this:

    
    
    ...