serialization - jQuery blueimp fileupload send only file params without other formdata -


i have form in user jquery file uploader

my form contains lot of other fields other profile picture user uploads. want upload profile picture sending profile picture parameters alone ajax , show user progress bar upload status.

here coffee script use this.

$('#user_edit_form').fileupload     url: '/users/files_upload'     type: 'post'     add: (e, data)->       # e.target gives form.       types = /(\.|\/)(gif|jpe?g|png)$/i       file = data.files[0]       # file type verification.       if types.test(file.type) || types.test(file.name)         data.progress_div = $('#' + data.fileinput.attr('id')).closest('.control-group').find('.upload_progress')         data.progress_div.show()         data.submit()       else         alert('the file selected not gif, jpeg or png image file')     progress: (e, data)->       progress = parseint(data.loaded / data.total * 100, 10)       data.progress_div.find('.bar').css('width', progress + '%') 

this code sends fields in form. need send file fields params. (i.e., nothing serializing file filed alone)

thanks


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -