Commit 1b6978e8 authored by Georgios Ouzounis's avatar Georgios Ouzounis
Browse files

Add 413 response handler in upload form

parent e1b75cb2
import Ember from "ember"; import Ember from "ember";
import ENV from 'frontend/config/environment';
var UploadController = Ember.Controller.extend({ var UploadController = Ember.Controller.extend({
session: Ember.inject.service('session'), session: Ember.inject.service('session'),
...@@ -114,12 +115,17 @@ var UploadController = Ember.Controller.extend({ ...@@ -114,12 +115,17 @@ var UploadController = Ember.Controller.extend({
progress.innerHTML = 'Failure. Your request to upload the application has failed. Try another application.'; progress.innerHTML = 'Failure. Your request to upload the application has failed. Try another application.';
} }
progress_text.innerHTML = ''; progress_text.innerHTML = '';
},
413: function () {
progress.clasName = "progress-bar progress-bar-danger";
progress_text.innerHTML = "The file you tried to upload exceeds the maximum allowed file size which is " + ENV.max_upload_file_Size + "KB";
progress.style.width = "0%";
} }
}, },
error: function() { error: function() {
progress.className = "progress-bar progress-bar-danger"; progress.className = "progress-bar progress-bar-danger";
progress.innerHTML = 'Your request to upload the file has been rejected. Please try again later.'; progress_text.innerHTML = 'Your request to upload the file has been rejected. Please try again later.';
progress_text.innerHTML = ''; progress.style.width = "0%";
} }
}); });
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment