ajax-upload

How to Use 'Ajax Upload' with Ruby on Rails?

心不动则不痛 提交于 2019-12-06 07:32:12
问题 I'm using this Script http://valums.com/ajax-upload/ to get Ajax upload working with Ruby on Rails but when i try uploading a file on my controller action I only get this: Parameters: {"qqfile"=>"Foo.png"} {"qqfile"=>"Foo.png", "action"=>"ul_file", "controller"=>"upload_files"} but i cant use this as a file and do things as thefile = params[:qqfile] foo = thefile.original_filename.slice(thefile.original_filename.rindex("."), thefile.original_filename.length).downcase what do i need to do to

The uploaded image not displayed after ajax upload in chrome

穿精又带淫゛_ 提交于 2019-12-04 22:36:54
I did an ajax upload with php.Everything wiil be perfect in firefox. But when i test it in chrome browser its not working correctly. That means it displays this : This is my ajax upload code: $(function(){ var cntUp = 0; var btnUpload=$('#upload0'); var status=$('#status'); var state='left_front'; new AjaxUpload(btnUpload, { action: 'upload-file.php', data: {saleid: $("#hid_saleid").val(),imag_state:state,custom:$('#custom').val()}, name: 'uploadfile', onSubmit: function(file, ext){ if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){ // extension is not allowed alert('Only JPG, PNG or GIF files

How to Use 'Ajax Upload' with Ruby on Rails?

南楼画角 提交于 2019-12-04 14:56:57
I'm using this Script http://valums.com/ajax-upload/ to get Ajax upload working with Ruby on Rails but when i try uploading a file on my controller action I only get this: Parameters: {"qqfile"=>"Foo.png"} {"qqfile"=>"Foo.png", "action"=>"ul_file", "controller"=>"upload_files"} but i cant use this as a file and do things as thefile = params[:qqfile] foo = thefile.original_filename.slice(thefile.original_filename.rindex("."), thefile.original_filename.length).downcase what do i need to do to get this script working with Ruby on Rails? Thanks. ///////// Updated This is how the JS looks Like $

Creating image from base64 string in NodeJS

爷,独闯天下 提交于 2019-12-04 04:04:09
I am trying to upload an image that I extract from a my canvas and post via ajax, and I have trouble creating the image file on my server side. I have following this answer: https://stackoverflow.com/a/7347358/1358670 but still I seem to miss something here or there. Here is my javascript (browser) code: var img = myCanvas.toDataURL("image/jpeg"); // ajax request to send the image and in server side, I do the following: var fd = fs.openSync('./img.jpeg', 'w'); req.body.image = req.body.image.replace(/^data:image\/\w+;base64,/, ""); console.log( req.body.image ); var buff = new Buffer(req.body

asp.net mvc ajax upload solution?

我只是一个虾纸丫 提交于 2019-12-03 07:46:17
问题 I'm looking for good ajax upload solution. I tried to use 1) SWFUpload (it is work fine but only for one file) 2) Jquery Ajax plugin (it's not working and it doesn't support progressbar in IE) I'd like to ask you what solutions do you use for Uploading multiple files with progress bar? 回答1: Personally I like Valums Ajax Upload. UPDATE: As requested in the comments section here's an example of how this could be used with ASP.NET MVC. Controller: public class HomeController : Controller {

Uploading a file with AngularJS and bluimp on success callback of another form

∥☆過路亽.° 提交于 2019-12-03 04:38:56
问题 I have followed the following tutorial in order to integrate the notorious bluimp jQuery file uploader in my AngularJS project. After some research I found that in the options array, witihn the jquery.fileuploader.js file, there is an option called autoUpload, which when set to true upload the file automatically. I tried to disable it(false, undefined), but quickly I learned out that this causes the upload not to function at all, not even on the form submit. I need to trigger the upload

asp.net mvc ajax upload solution?

让人想犯罪 __ 提交于 2019-12-02 21:16:50
I'm looking for good ajax upload solution. I tried to use 1) SWFUpload (it is work fine but only for one file) 2) Jquery Ajax plugin (it's not working and it doesn't support progressbar in IE) I'd like to ask you what solutions do you use for Uploading multiple files with progress bar? Personally I like Valums Ajax Upload . UPDATE: As requested in the comments section here's an example of how this could be used with ASP.NET MVC. Controller: public class HomeController : Controller { public ActionResult Index() { return View(); } [HttpPost] public ActionResult Upload(string qqFile) { // The

Uploading a file with AngularJS and bluimp on success callback of another form

醉酒当歌 提交于 2019-12-02 17:47:37
I have followed the following tutorial in order to integrate the notorious bluimp jQuery file uploader in my AngularJS project. After some research I found that in the options array, witihn the jquery.fileuploader.js file, there is an option called autoUpload, which when set to true upload the file automatically. I tried to disable it(false, undefined), but quickly I learned out that this causes the upload not to function at all, not even on the form submit. I need to trigger the upload manually, say within another callback, or by a click event. can that be done?. code: app.directive(

jquery form plugin, no error handling

送分小仙女□ 提交于 2019-11-29 23:09:58
It seems that there are no error handling facility in the Jquery.Form plugin, which is very frustrating. Even though the documentation says we can use the $.ajax options, I still cannot make use of the 'error' option when the server returns an error, especially the 500 and 400 series. Is it that this plugin cannot handle any error at all from the server or is it a bug, etc? Can someone please tell me how I can handle errors (400, 500, etc) with this plugin? I need your help... All I want is a simple error handling... Thank you. $("#uploadingImg").hide(); var options = {//Define ajax options

Blueimp file uploader with IE9

拜拜、爱过 提交于 2019-11-29 15:12:17
I am uploading a file to a REST API using this plugin in an AngularJS application. When seconds after the 'fileuploaddone' event fires, I get a yellow notification from Internet Explorer saying: Would you like to save \ open the Screenshot attached. Iframe based uploads require a Content-type of text/plain or text/html for the JSON response - they will show an undesired download dialog if the iframe response is set to application/json. Source: https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation You will need to set the right Content-Type as explained in the link