diff --git a/.versions b/.versions index f8b8f19..b862d23 100644 --- a/.versions +++ b/.versions @@ -21,7 +21,7 @@ fetch@0.1.1 geojson-utils@1.0.10 id-map@1.1.1 inter-process-messaging@0.1.1 -local-test:ostrio:files@2.3.1 +local-test:ostrio:files@2.3.2 logging@1.3.1 meteor@1.10.1 minimongo@1.9.0 @@ -35,7 +35,7 @@ mongo-id@1.0.8 npm-mongo@4.9.0 ordered-dict@1.1.0 ostrio:cookies@2.7.2 -ostrio:files@2.3.1 +ostrio:files@2.3.2 promise@0.12.0 random@1.2.0 react-fast-refresh@0.2.3 diff --git a/package.js b/package.js index 5d5b4b1..cea2ad0 100755 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ name: 'ostrio:files', - version: '2.3.1', + version: '2.3.2', summary: 'Upload files to a server or 3rd party storage: AWS:S3, GridFS, DropBox, and other', git: 'https://github.com/veliovgroup/Meteor-Files', documentation: 'README.md' diff --git a/write-stream.js b/write-stream.js index 2869f03..8bb6481 100644 --- a/write-stream.js +++ b/write-stream.js @@ -1,4 +1,5 @@ import fs from 'fs-extra'; +import nodePath from 'path'; import { Meteor } from 'meteor/meteor'; import { helpers } from './lib.js'; const noop = () => {}; @@ -42,18 +43,18 @@ export default class WriteStream { fs.stat(this.path, (statError, stats) => { bound(() => { if (statError || !stats.isFile()) { - const paths = this.path.split('/'); + const paths = this.path.split(nodePath.sep); paths.pop(); try { - fs.mkdirSync(paths.join('/'), { recursive: true }); + fs.mkdirSync(paths.join(nodePath.sep), { recursive: true }); } catch (mkdirError) { - throw new Meteor.Error(500, `[FilesCollection] [writeStream] [constructor] [mkdirSync] ERROR: can not make/ensure directory ${paths.join('/')}`, mkdirError); + throw new Meteor.Error(500, `[FilesCollection] [writeStream] [constructor] [mkdirSync] ERROR: can not make/ensure directory "${paths.join(nodePath.sep)}"`, mkdirError); } try { fs.writeFileSync(this.path, ''); } catch (writeFileError) { - throw new Meteor.Error(500, `[FilesCollection] [writeStream] [constructor] [writeFileSync] ERROR: can not write file ${this.path}`, writeFileError); + throw new Meteor.Error(500, `[FilesCollection] [writeStream] [constructor] [writeFileSync] ERROR: can not write file "${this.path}"`, writeFileError); } }