meteor-uploads icon indicating copy to clipboard operation
meteor-uploads copied to clipboard

Sudden issue with uploaded files & their directory

Open thegizzada opened this issue 8 years ago • 6 comments

newproblem

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.

thegizzada avatar Mar 18 '16 04:03 thegizzada

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.

thegizzada avatar Mar 18 '16 07:03 thegizzada

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.

tomitrescak avatar Mar 18 '16 08:03 tomitrescak

I got this error too,(on ubuntu linux server.14.04 64bit), but it's ok on windows.

downup2u avatar Mar 21 '16 09:03 downup2u

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).

msj121 avatar May 03 '16 20:05 msj121

Current solution I found was to add "/" to line 469:

var destinationFile = currentFolder +"/"+ newFileName;

It now works as expected.

msj121 avatar May 03 '16 22:05 msj121

Whats up with this? Why has this been broken. I noticed the suggested fix is the behaviour of 1.3.3

dasdeck avatar Jul 04 '16 14:07 dasdeck