meteor-uploads
meteor-uploads copied to clipboard
Sudden issue with uploaded files & their directory

imageVersions: { metathumbnail: {width: 600, height: 315}, thumbnail: {width: 600, height: 600} },
getDirectory: function(fileInfo, formData) { var directory = ''; if(fileInfo) { if(fileInfo.type === 'image/png'){ directory = 'image'; } if(fileInfo.type === 'image/jpeg'){ directory = 'image'; } } fileInfo.originalname = fileInfo.name; return directory; },
In my app I have relied on this for weeks, however something strange has began to occur ever since the;
tomi:upload-jquery upgraded from 2.2.2 to 2.2.3 tomi:upload-server upgraded from 1.3.3 to 1.3.4
Where the images would once be put in their correct folders (thumbnails & original), they no longer are, and instead are named incorrectly.
Also upon calling;
UploadServer.delete(image/a791e61bb19ee6ba4.jpg);
I get the following error;
Exception while invoking method 'removefile' Error: ENOENT, no such file or directory '/Users/-/-/-/-/-/.uploads/metathumbnail/image/a791e61bb19ee6ba4.jpg'
I cannot make any sense of the path. I'll reiterate that this code functioned for weeks previously, however not anymore & has broken down across three apps subsequent to updating.
Christopher, I apologise, there was a PR recently that dealt with having upload on a different drive, that must have had messed up the original functionality. My tests worked well, so I must have missed something,. Would you have capacity to check out the server commits and see if there is an obvious problem? I will have time in the beginning of the next week to look at it.
I got this error too,(on ubuntu linux server.14.04 64bit), but it's ok on windows.
A current workaround for me is to append "/" to the end of the "getDirectory" function. Sadly this puts a double slash in the url, but it still works in chrome.
Perhaps this might help find the problem. Perhaps there is a bad character in the code that works for windows and not unix/linux. (I am seeing this issue on my mac).
Current solution I found was to add "/" to line 469:
var destinationFile = currentFolder +"/"+ newFileName;
It now works as expected.
Whats up with this? Why has this been broken. I noticed the suggested fix is the behaviour of 1.3.3