'append' called on an object that does not implement interface FormData

前端 未结 5 1735
误落风尘
误落风尘 2020-12-02 09:57

I\'m Trying to upload image on with jquery and ajax. But weird thing happened here. In console Log its showing

TypeError: \'append\' called on an obj

5条回答
  •  [愿得一人]
    2020-12-02 10:07

    Adding:

    processData: false,
    contentType: false,
    

    will definitely help with the file, an aside to that is if you are doing any sort of passing errors or success messages back to the page, you will want to use json to make your life easier.

    example:

    dataType: 'json',
    

    this will help with parsing your responses. Without it, it will throw an error.

提交回复
热议问题