Skip to content

Commit

Permalink
Merge pull request #561 from VeliovGroup/dev
Browse files Browse the repository at this point in the history
v1.9.6
  • Loading branch information
dr-dimitru authored Jan 17, 2018
2 parents 93747a6 + ba25aea commit f3f9a7e
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .versions
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ [email protected]
[email protected]
[email protected]
ostrio:[email protected]
ostrio:[email protected].5
ostrio:[email protected].6
[email protected]
[email protected]
[email protected]
Expand Down
17 changes: 17 additions & 0 deletions core.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export default class FilesCollectionCore extends EventEmitter {
}

static schema = {
_id: {
type: String
},
size: {
type: Number
},
Expand Down Expand Up @@ -44,6 +47,20 @@ export default class FilesCollectionCore extends EventEmitter {
type: String,
optional: true
},
ext: {
type: String,
optional: true
},
extensionWithDot: {
type: String,
optional: true
},
mime: {
type: String,
},
'mime-type': {
type: String,
},
_storagePath: {
type: String
},
Expand Down
11 changes: 11 additions & 0 deletions docs/insert.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@
Set to dataURI {<em>String</em>} for Base64
</td>
</tr>
<tr>
<td align="right">
<code>settings.fileName</code> {<em>String</em>}
</td>
<td>
[REQUIRED] <strong>only</strong> for <code>base64</code> uploads
</td>
<td>
For regular uploads this option is [OPTIONAL], will replace default file's name provided in HTML5 <code>files</code> item
</td>
</tr>
<tr>
<td align="right">
<code>settings.isBase64</code> {<em>Boolean</em>}
Expand Down
17 changes: 17 additions & 0 deletions docs/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ For more info see [Collection2](https://github.com/aldeed/meteor-collection2) an

```javascript
var defaultSchema = {
_id: {
type: String
},
size: {
type: Number
},
Expand Down Expand Up @@ -40,6 +43,20 @@ var defaultSchema = {
type: String,
optional: true
},
ext: {
type: String,
optional: true
},
extensionWithDot: {
type: String,
optional: true
},
mime: {
type: String,
},
'mime-type': {
type: String,
},
_storagePath: {
type: String
},
Expand Down
4 changes: 2 additions & 2 deletions lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ const formatFleURL = (fileRef, version = 'original') => {
check(version, String);

const _root = __meteor_runtime_config__.ROOT_URL.replace(/\/+$/, '');
const vRef = ((fileRef.versions && fileRef.versions[version]) || fileRef);
const vRef = (fileRef.versions && fileRef.versions[version]) || fileRef || {};

if (vRef.extension && _.isString(vRef, 'extension')) {
if (_.isString(vRef.extension)) {
ext = `.${vRef.extension.replace(/^\./, '')}`;
} else {
ext = '';
Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: 'ostrio:files',
version: '1.9.5',
version: '1.9.6',
summary: 'File upload via DDP/HTTP to server, 3rd party storage support: AWS S3, GridFS, DropBox and others',
git: 'https://github.com/VeliovGroup/Meteor-Files',
documentation: 'README.md'
Expand Down
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export class FilesCollection extends FilesCollectionCore {

if (!this.disableUpload) {
this._preCollection = new Mongo.Collection(`__pre_${this.collectionName}`);
this._preCollection._ensureIndex({createdAt: 1}, {expireAfterSeconds: this.continueUploadTTL, background: true});
this._preCollection._ensureIndex({ createdAt: 1 }, { expireAfterSeconds: this.continueUploadTTL, background: true });
const _preCollectionCursor = this._preCollection.find({}, {
fields: {
_id: 1,
Expand Down

0 comments on commit f3f9a7e

Please sign in to comment.