javascript - ajax image file submitted together with text box data for upload processing
迷茫
迷茫 2017-05-31 10:41:10
0
1
718

Select a local image file, enter some data in the input box and click Submit. After submission, an Uncaught TypeError: Illegal invocation error will be reported directly. Illegal call, the file cannot be used forData and cannot be placed in json

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
某草草

If you want to submit the file using ajax, there are basically three ways
1. You can encapsulate your file with formdata, and then put in the ajax data.
2. You can use the jquery from plug-in to upload Wenjia directly.
3. You can convert local files into base64 format, and then submit them in the same way as ordinary text formats. Then convert base64 to an image on the server side.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template