使用.post()和enctype ="multipart/form-data"形式 [英] Using .post() and enctype="multipart/form-data" form

查看:406
本文介绍了使用.post()和enctype ="multipart/form-data"形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用$ .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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆