Firefox jquery-file-upload issue
Hello we are using jquery-file-upload-for-rails and paperclip gems (latest
versions) and we are facing an issue with Firefox.
We have an input named avatar. When the user selects a file the upload
process gets triggered. The progress bar becomes visible and when the
upload is completed the page should reload. This seems to work in Chrome
correctly but fails in Firefox. The following code is being used.
Form input and progress bar (HAML):
%div
= f.input :avatar, as: :file, multiple: true, wrapper_html: { id:
'fileupload-widget' }
#progress.progress.progress-success.progress-striped.active{style:"opacity:0"}
.bar.bar-success{style: 'width: 0%;'}
coffeescript:
$ ->
$("#fileupload-widget").fileupload
dataType: "json"
autoUpload: true
add: (e, data) ->
$("#progress").css(
"opacity", "100"
)
data.submit()
progressall: (e, data) ->
progress = parseInt(data.loaded / data.total * 100, 10)
$("#progress .bar").css(
"width",
progress + "%"
)
if progress >= 80
window.location.reload()
Server logs contain the responses to the two requests - Post request for
upload file - Get request to reload current page In Chrome, works like a
charm. In Firefox, the page after the selection of the file doesn't
reload.
No comments:
Post a Comment