我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

处理Ajax上传的最佳方法?

form_for @model, :remote => true, :html => {:multipart => true } does not allow us to send file via ajax.

I have found this but it's not up to date and it relies on dependancies :

  • http://khamsouk.souvanlasy.com/articles/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent
  • http://www.williambharding.com/blog/rails/rails-ajax-image-uploading-made-simple-with-jquery/

Anyone with up to date ressources ?

This is example for uploading File on Rails 3 using Jquery.

Make use of it, it is simple

https://github.com/blueimp/jQuery-File-Upload/wiki/jQuery-File-Upload-for-Rails-3

I've used Uploadify in a recent application http://www.uploadify.com/ Some Rails specific notes here http://railstips.org/blog/archives/2009/07/21/uploadify-and-rails23/ I know you said Rails 3, but the concepts are the same.

近期文章

  • 使用Ajax在模态上编辑数据
  • 显示文本框输入消息
  • 使用jQuery自动ajax选择器
  • Ajax表单验证,JSON代码
  • 动态添加控件和AJAX
  • Umbraco-使用Ajax加载内容
  • 如何反序列化发布的数据?
  • grails和AJAX动态搜索
  • 将AJAX与asp一起使用:日历
  • 用化妆水处理自动完成
  • 基本Ruby on Rails AJAX错误
  • Asp.Net C#-> Javascript Ajax
  • 评估未在javascript中运行
  • 摆脱IE下载警告
  • 基于jQuery锚的导航
  • 在ajax调用之后-$ {document).ready();?
  • 使用jQuery Ajax刷新页面
  • 始终执行事件错误$ .ajax
  • 如何在ajax url中编码“ +”符号
  • ASP MVC适当的ajax用法

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华