Commit eb07531e authored by Georgios Ouzounis's avatar Georgios Ouzounis
Browse files

Limit uploaded file name to 100 characters

This is done to comply with the restriction in Application model of
the backend API
parent f9d2c0ec
......@@ -4,6 +4,7 @@ var UploadController = Ember.Controller.extend({
session: Ember.inject.service('session'),
wrongExt: false,
outOfSpace: false,
tooLongName: false,
userHasEnteredData: false,
submitDisabled: false,
enoughQuotas: false,
......@@ -14,6 +15,7 @@ var UploadController = Ember.Controller.extend({
this.setProperties({
wrongExt: false,
outOfSpace: false,
tooLongName: false
});
var host = this.store.adapterFor('upload-app').get('host'),
......@@ -47,6 +49,9 @@ var UploadController = Ember.Controller.extend({
this.set('fileSize', file_size);
this.set('outOfSpace', true);
}
else if (file.files[0].name.length > 100){
this.set('tooLongName', true);
}
else if (ext !== "jar")
{
this.set("wrongExt", true);
......
......@@ -36,6 +36,14 @@ var UploadRoute = Ember.Route.extend(AuthenticatedRouteMixin, {
model.userOkeanosProjects.objectAt(i).deleteRecord();
}
}
},
setupController: function(controller, model){
this._super(controller, model);
controller.set('wrongExt', false);
controller.set('outOfSpace', false);
controller.set('tooLongName', false);
}
});
......
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