Commit 88fd757b authored by asseldonk's avatar asseldonk
Browse files

filebrowser: fixed error in multiple upload, fixed #2039

parent ef93f063
...@@ -237,7 +237,7 @@ class FSAjaxController(AbstractController): ...@@ -237,7 +237,7 @@ class FSAjaxController(AbstractController):
parts = [parts] parts = [parts]
path = kwargs['path'] path = kwargs['path']
filename = fs.handle_file_name_collision(parts[0].filename, path)
for part in parts: for part in parts:
append = False append = False
force = True force = True
...@@ -245,7 +245,7 @@ class FSAjaxController(AbstractController): ...@@ -245,7 +245,7 @@ class FSAjaxController(AbstractController):
data = part.file.read(1024 * 1024) data = part.file.read(1024 * 1024)
if len(data) <= 0: if len(data) <= 0:
break break
success, msg = fs.save_file_content(part.filename, data, success, msg = fs.save_file_content(filename, data,
path=path, force=force, path=path, force=force,
append=append) append=append)
if not success: if not success:
......
...@@ -410,12 +410,12 @@ var FileBaseActions = Class.extend({ ...@@ -410,12 +410,12 @@ var FileBaseActions = Class.extend({
done: function() { done: function() {
//self.FileBase.updateView(); //self.FileBase.updateView();
vispa.messenger.info("Upload succeeded", "glyphicon glyphicon-ok-sign"); vispa.messenger.info("Upload succeeded", "glyphicon glyphicon-ok-sign");
$(this).remove();
}, },
fail: function() { fail: function() {
vispa.messenger.info("Upload failed", "glyphicon glyphicon-warning-sign"); vispa.messenger.info("Upload failed", "glyphicon glyphicon-warning-sign");
} }
}).trigger("click"); }).trigger("click");
return this;
}, },
filter: function() { filter: function() {
......
...@@ -479,6 +479,7 @@ class FileSystem(object): ...@@ -479,6 +479,7 @@ class FileSystem(object):
def handle_file_name_collision(self, name, path): def handle_file_name_collision(self, name, path):
# collision? # collision?
path = self.expand(path)
files = os.listdir(path) files = os.listdir(path)
if name not in files: if name not in files:
return name return name
......
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