JavaScript Post Request w / Image [英] JavaScript Post Request w/ Image

查看:92
本文介绍了JavaScript Post Request w / Image的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

恐怕我可能已经知道了答案。我希望离线呈现HTML5表单,用户可以在其中选择要上载的图像。一旦用户重新上线,图像将被上传。我可以从文件输入中提取所有数据,但有没有办法通过post发送数据来保存服务器上的blob?

I'm afraid I might know the answer to this already. I'm hoping to present an HTML5 form offline in which a user can select an Image to upload. Once the user gets back on line the image will be uploaded. I can extract all the data from the file input, but is there a way to send the data via post to save the blob on the server?

我正在使用jQuery并有一个Rails后端(典型的文件上传量通过CarrierWave处理)。

I'm using jQuery and have a Rails backend (typical fileuploads are handled through CarrierWave).

推荐答案

你可以在线创建 / code>事件并在包含您的文件图像的表单上调用 submit()

  • http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml
  • http://api.jquery.com/submit/

这篇关于JavaScript Post Request w / Image的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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