Skip to content

Conversation

@titovanton
Copy link

It is very small patch:

-  getDirectory: function (fileInfo, formData) {
+  getDirectory: function (req, fileInfo, formData) {
-  getFileName: function (fileInfo, formData) {
+  getFileName: function (req, fileInfo, formData) {

This parameter let me handle re.query inside getDirectory, where i can pass the HTTP GET parameter to manipulate of subdirectory path from the client.

@titovanton
Copy link
Author

Ok, I found the bug...
First of all, I want to say thank you for ur upload-server. It works. But u do not follow conventions :/ , so ur code is very hard to read(especially for noobs like me).
Also, always use path.join instead concatination(that's about ur bug):

-    var destinationFile = currentFolder + newFileName;
+    var destinationFile = path.join(currentFolder, newFileName);

@titovanton
Copy link
Author

titovanton commented May 6, 2016

so, the result of ur concatination is:

/path/tofilename

instead:

/path/to/filename

there r alot of concatinations in ur code more, but it seems it works :) It would be awesome to refactor ur code and cover with tests...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant