diff --git a/index.js b/index.js index 1b4c1ec..92575ef 100644 --- a/index.js +++ b/index.js @@ -309,6 +309,11 @@ module.exports = function defineUploadsHook(sails) { sniffed = sniffReadableStream(upstreamOrFileStream, omen); } catch (err) { return done(err); } + var adapterOpts = _.extend({}, sails.config.uploads, moreOptions); + if (adapterOpts.adapter || defaultFilesystemAdapter === defaultFilesystemAdapter) { + upstreamOrFileStream.skipperFd = adapterOpts.dirpath + '/' + upstreamOrFileStream.skipperFd; + } + return done(undefined, { fd: upstreamOrFileStream.skipperFd, name: sniffed.name, diff --git a/package.json b/package.json index 10c4d06..5f07927 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sails-hook-uploads", - "version": "0.4.0", + "version": "0.4.1", "description": "A hook for wrapping file upload support with async/await in Sails.", "main": "index.js", "scripts": {