Closed Sashkan closed 7 years ago
Hi @Sashkan, what is causing that may depend either on your setup and/or your specific implementation of the uploads handling process. Also, you may want to check enyo/dropzone#95, as that's the actual repo for the JS library, this is just a wrapper gem.
Anyhow, if you could provide me with more info, I might be able to see if there's anything suspicious on the Ruby side.
Sure :)
Here are the basics: First, the Dropzone call:
var myDropzone = new Dropzone("#resources-dropzone", {
url: "<%= upload_resources_path %>",
maxFilesize: 1000
});
myDropzone.on("complete", function(file) {
location.reload();
});
$(document).ready(function() {
var url = document.location.toString();
if (url.match('#')) {
$('.order-tabs a[href=#'+url.split('#')[1]+']').click();
}
});
All files are processed with the following rb function
def upload_resources
authorize(:brief, :upload_resources?)
@path = upload_resources_path(Brief.find(params[:id]))
@resource = Resource.new
@resource.file = params[:file]
@resource.uploader_id = current_user.id
@resource.brief_id = params[:brief_id]
if @resource.save
flash[:notice] = t('resources.upload.done')
else
puts @resource.errors.full_messages
end
render :nothing => true
end
Funny thing is, it only occurs when I try to upload huge files (Like, > 500MB)
@Sashkan and what do you get on the browser DevTools network/console panes? Do you see any JS error? Is the AJAX request stuck/unresponsive?
Nope, no errors. However, for some weird reason, I got absolutely no css/js upload progress animation (Though, I don't think it has anything t o do with the double-upload issue)
And have you tracked on the Ruby side if the request for those large files is being received twice? That would help on isolating on which side of the communication the problem is being raised.
Closing this out due to inactivity.
I'm using dropzone to handle uploads in a rails app. It works just fine with small files, but unfortunately, when it comes to files > 300MB, things go sour: The upload animation freezes (nevers reaches its 'complete' state), user have to reload the page, only to see that his file uploaded twice.
Is there a way to prevent this behaviour ?