使用.post()和enctype ="multipart/form-data"形式 [英] Using .post() and enctype="multipart/form-data" form
问题描述
如何使用$ .post().serialize()参与具有enctype ="multipart/form-data"的表单?
How do you use a $.post().serialize() to participate with a form that has a enctype="multipart/form-data" ?
在这里阅读对第三回答者的评论: 使用multipart/form-进行HTTP POST调用数据使用jQuery吗?
Was reading the comment to the 3rd answerer here: Making an HTTP POST call with multipart/form-data using jQuery?
指的是什么?我只需要提交它,我并没有尝试读取客户端文件,但是服务器脚本似乎无法正确读取数据.
What is that referring to? I just need to submit it, i'm not trying to read the file client-side, but the server script doesn't seem to be reading the data properly.
谢谢.
推荐答案
您无法通过ajax上传文件.
You can't upload files via ajax.
您可以尝试使用iframe和其他方法(例如Java和Flash上传器)来伪造类似ajax的文件.
You can try to fake the ajax-like upload using iframes, other methods, like java and flash uploaders.
这篇关于使用.post()和enctype ="multipart/form-data"形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!