Skip to content

Commit

Permalink
Merge pull request #120 from VeliovGroup/dev
Browse files Browse the repository at this point in the history
v1.6.0
 - `ostrio:files` package was awarded in [GCAA 2016](https://themeteorchef.com/blog/giant-cotton-apron-awards-show) as simple, smooth and versatile file-upload package
 - Support for `[email protected]`
 - Implementation of Cursor for `.findOne()` as the `FileCursor`
 - Implementation of Cursor for `.find()` as the `FilesCursor`
 - `updatedAt.autoValue` is removed from default schema, now this field is optional
 - `_prefix` is removed from default schema
 - Default schema now has `isPDF` property
 - If user not logged in or package `accounts-base` isn’t installed `.user()` method always returns `null`
 - Update dependency to fixed cookie package
 - Implement queue stream - to make 100% sure chunks is written in desired order
 - Constructor: `config.continueUploadTTL` {*Number*} - [Server] Time in seconds, during upload may be continued, default 3 hours (10800 seconds)
 - Constructor: `config.onAfterRemove` {*Function*} - [Server] callback, see #114
 - Constructor: `config.collection` {Mongo.Collection} - [Both] MongoDB Collection Instance
 - Latency compensation for `estimateTime`
 - Major fixes an improvements in file streaming
 - Better debug logs
 - Better memory management
 - Remove dependency to `sha` package
 - Send over the wire as small amount of meta-data, as possible
 - Fix `finishUpload` - now it is emitted only after file is fully written to FS
 - Fix when sending `Date()` Object over HTTP upload in `meta` Object
 - Fix issue when `userId` was `null` in browsers with no localStorage support
 - Fix for `fileRef` passed into `protected` callback
 - Fix upload when first chunk isn’t actually first
 - Fix resume upload in `http` transport
 - Fix `.continue()` after broken connection
 - Fix when file loaded via `.load()` method has no `content-length` and/or `content-type` headers
 - Fix #114
 - Fix #100 - Allow to pass `fileName` property to `.insert()` method
 - Fix #103
 - Fix #99
 - Fix #97
 - [AWS:S3 Integration example](https://github.com/VeliovGroup/Meteor-Files/wiki/AWS-S3-Integration)

__Breaking changes__:
 - Minimum required version of Meteor is `1.3.3.1`
 - `. checkAccess()` (`.protected()`) methods isn’t called anymore on `.find()`, `.findOne()`, `.remove()`, `.insert()`. Use `onBeforeRemove` and `onBeforeUpload` callbacks to control user access
 - Implement Cursor for `FilesCollection`, as `FileCursor `
 - Methods `.find()` and `.findOne()` now always returns `FileCursor` instance
 - Methods `.get()` and `.fetch()` now moved to `FileCursor`, and not available on `FilesCollection` instance
 - `onBeforeUpload()` callback now receives `FileCursor` as argument
 - `.link()` method is requires first argument
 - All internal methods, events and properties now has `_` prefix
 - Property `ext` on *fileRef* is __deprecated__ use __extension__ instead

[Demo Application](https://files.veliov.com)
 - Use AWS:S3 as storage
 - New design
 - PDF preview
 - GitHub Markdown support and highlighting
 - Basic SEO
 - Valid Schema.org markup
 - Accounts: Now you can login via Facebook, Twitter, GitHub or Meteor account. And have your private or unlisted files
  • Loading branch information
dr-dimitru authored Jul 2, 2016
2 parents f770331 + c2d4440 commit 18de999
Show file tree
Hide file tree
Showing 113 changed files with 5,290 additions and 1,934 deletions.
77 changes: 38 additions & 39 deletions .versions
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
babel-compiler@6.6.4
[email protected].8
[email protected].8
[email protected].7
[email protected].8
[email protected].8
[email protected].4
babel-compiler@6.8.3
[email protected].9_1
[email protected].9
[email protected].8
[email protected].9
[email protected].9
[email protected].5_1
[email protected]
[email protected].1
coffeescript@1.0.17
[email protected].3
coffeescript@1.1.2_1
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
ostrio:[email protected]
ostrio:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]_1
[email protected]_1
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]_1
[email protected]_1
[email protected]_1
[email protected]
[email protected]_1
[email protected]
[email protected]
ostrio:[email protected]
ostrio:[email protected]
[email protected]_1
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]_1
[email protected]
[email protected].13
[email protected].14
[email protected]
[email protected].8
[email protected].9
[email protected].8
[email protected].9
[email protected].10
[email protected].9_1
[email protected]
61 changes: 38 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ Support:
- [Releases / Changelog / History](https://github.com/VeliovGroup/Meteor-Files/releases)
- For more docs and examples [read wiki](https://github.com/VeliovGroup/Meteor-Files/wiki)

Awards:
========
<a href="https://themeteorchef.com/blog/giant-cotton-apron-awards-show"><img src="https://s3.amazonaws.com/tmc-post-content/gcaa-2016-winner-badge.svg"></a>


Demo application:
========
- [Live](https://meteor-files.herokuapp.com/) (*Unavailable after 6 hours of uptime, due to [free plan](https://www.heroku.com/pricing)*)
- [Live](https://files.veliov.com)
- [Source](https://github.com/VeliovGroup/Meteor-Files/tree/master/demo)
- [Compiled Demo App](https://github.com/VeliovGroup/Meteor-Files-Demo)
- [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/VeliovGroup/Meteor-Files-Demo)

ToC:
Expand All @@ -26,17 +32,17 @@ ToC:
- [Install](https://github.com/VeliovGroup/Meteor-Files#install)
- [API](https://github.com/VeliovGroup/Meteor-Files#api-overview-full-api):
* [Initialize Collection](https://github.com/VeliovGroup/Meteor-Files#new-filescollectionconfig-isomorphic)
* [Upload file](https://github.com/VeliovGroup/Meteor-Files#insertsettings-client)
* [Upload file](https://github.com/VeliovGroup/Meteor-Files#insertsettings-autostart-client)
* [Stream files](https://github.com/VeliovGroup/Meteor-Files#stream-files)
* [Download Button](https://github.com/VeliovGroup/Meteor-Files#download-button)

Why `Meteor-Files`?
========
The `cfs` is a well known package, but it's huge monster which combines everything. In `Meteor-Files` is nothing to broke, it's simply upload/store/serve files to/from server.
- Support for both `HTTP` and `DDP` transports for upload
- You need store to *GridFS*, *AWS* or *DropBox*? (*[Use third-party storage](https://github.com/VeliovGroup/Meteor-Files/wiki/Third-party-storage)*) - *Add it yourself*
- You need store to *[GridFS](https://github.com/VeliovGroup/Meteor-Files/wiki/GridFS-Integration)*, *[AWS S3](https://github.com/VeliovGroup/Meteor-Files/wiki/AWS-S3-Integration)* or *[DropBox](https://github.com/VeliovGroup/Meteor-Files/wiki/Third-party-storage)*? (*[Use 3rd-party storage](https://github.com/VeliovGroup/Meteor-Files/wiki/Third-party-storage)*) - *Add it yourself*
- You need to check file mime-type, size or extension? (*[`onBeforeUpload`](https://github.com/VeliovGroup/Meteor-Files/wiki/Constructor)*) - *Add it yourself*
- You need to resize images after upload? (*[`onAfterUpload`](https://github.com/VeliovGroup/Meteor-Files/wiki/Constructor)*, *[file's subversions](https://github.com/VeliovGroup/Meteor-Files/wiki/Create-and-Manage-Subversions)*) - *Add it yourself*
- You need to [resize images](https://github.com/VeliovGroup/Meteor-Files/blob/master/demo/server/image-processing.coffee) after upload? (*[`onAfterUpload`](https://github.com/VeliovGroup/Meteor-Files/wiki/Constructor)*, *[file's subversions](https://github.com/VeliovGroup/Meteor-Files/wiki/Create-and-Manage-Subversions)*) - *Add it yourself*

Easy-peasy kids, *yeah*?

Expand All @@ -58,7 +64,7 @@ var Images = new FilesCollection({
allowClientCode: false, // Disallow remove files from Client
onBeforeUpload: function (file) {
// Allow upload files under 10MB, and only in png/jpg/jpeg formats
if (file.size <= 10485760 && /png|jpg|jpeg/i.test(file.ext)) {
if (file.size <= 10485760 && /png|jpg|jpeg/i.test(file.extension)) {
return true;
} else {
return 'Please upload image, with size equal or less than 10MB';
Expand All @@ -72,7 +78,7 @@ if (Meteor.isClient) {

if (Meteor.isServer) {
Meteor.publish('files.images.all', function () {
return Images.collection.find({});
return Images.find().cursor;
});
}
```
Expand All @@ -84,14 +90,12 @@ Read full docs for [`insert()` method](https://github.com/VeliovGroup/Meteor-Fil
Upload form (template):
```html
<template name="uploadForm">
{{#if currentUpload}}
{{#with currentUpload}}
Uploading <b>{{file.name}}</b>:
<span id="progress">{{progress}}%</span>
{{/with}}
{{#with currentUpload}}
Uploading <b>{{file.name}}</b>:
<span id="progress">{{progress.get}}%</span>
{{else}}
<input id="fileInput" type="file" />
{{/if}}
{{/with}}
</template>
```

Expand Down Expand Up @@ -145,15 +149,19 @@ For more expressive example see [Upload demo app](https://github.com/VeliovGroup


#### Stream files
To display files you will use `fileURL` template helper.
To display files you can use `fileURL` template helper or `.link()` method of `FileCursor`.

Template:
```html
<template name='file'>
<img src="{{fileURL imageFile}}" alt="{{imageFile.name}}" />
<img src="{{imageFile.link}}" alt="{{imageFile.name}}" />
<!-- Same as: -->
<!-- <img src="{{fileURL imageFile}}" alt="{{imageFile.name}}" /> -->
<hr>
<video height="auto" controls="controls">
<source src="{{fileURL videoFile}}?play=true" type="{{videoFile.type}}" />
<source src="{{videoFile.link}}?play=true" type="{{videoFile.type}}" />
<!-- Same as: -->
<!-- <source src="{{fileURL videoFile}}?play=true" type="{{videoFile.type}}" /> -->
</video>
</template>
```
Expand All @@ -175,10 +183,10 @@ if (Meteor.isServer) {
});

Meteor.publish('files.images.all', function () {
return Images.collection.find({});
return Images.find().cursor;
});
Meteor.publish('files.videos.all', function () {
return Videos.collection.find({});
return Videos.find().cursor;
});

} else {
Expand All @@ -191,10 +199,10 @@ Client's code:
```javascript
Template.file.helpers({
imageFile: function () {
return Images.collection.findOne({});
return Images.findOne();
},
videoFile: function () {
return Videos.collection.findOne({});
return Videos.findOne();
}
});
```
Expand All @@ -206,8 +214,8 @@ For more expressive example see [Streaming demo app](https://github.com/VeliovGr
Template:
```html
<template name='file'>
<a href="{{fileURL fileRef}}?download=true" download="{{fileRef.name}}" target="_parent">
{{fileRef.name}}
<a href="{{file.link}}?download=true" download="{{file.name}}" target="_parent">
{{file.name}}
</a>
</template>
```
Expand All @@ -226,7 +234,7 @@ if (Meteor.isServer) {
});

Meteor.publish('files.images.all', function () {
return Images.collection.find({});
return Images.find().cursor;
});
} else {
Meteor.subscribe('files.images.all');
Expand All @@ -237,12 +245,19 @@ Client's code:
```javascript
Template.file.helpers({
fileRef: function () {
return Images.collection.findOne({});
return Images.findOne();
}
});
```
For more expressive example see [Download demo](https://github.com/VeliovGroup/Meteor-Files/tree/master/demo-simplest-download-button)


Supporters:
========
Big thanks to all supporters. *Only because of this guys this project can have 100% of our attention*.
- [@themeteorchef](https://github.com/themeteorchef)
- [@MeDBejoHok](https://github.com/medbejohok)

----

| Meteor-Files | Expressive package to manage files within Meteor |
Expand Down
2 changes: 1 addition & 1 deletion demo-simplest-download-button/.meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[email protected].2.4
[email protected].4.1
117 changes: 58 additions & 59 deletions demo-simplest-download-button/.meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -3,76 +3,75 @@ aldeed:[email protected]
aldeed:[email protected]
aldeed:[email protected]
aldeed:[email protected]
[email protected].4
[email protected].9
babel-compiler@6.6.4
[email protected].8
[email protected].8
[email protected].8
[email protected].7
[email protected].5
[email protected].10
babel-compiler@6.8.3
[email protected].9_1
[email protected].9
[email protected].9
[email protected].8
[email protected]
[email protected].8
[email protected].8
[email protected].4
[email protected].9
[email protected].9
[email protected].5_1
[email protected]
[email protected].8
[email protected].1
coffeescript@1.0.17
[email protected].9
[email protected].3
coffeescript@1.1.2_1
[email protected]
[email protected].7
[email protected].5
[email protected].6
[email protected].8_1
[email protected].6
[email protected].8_1
[email protected]
[email protected].5
[email protected].3
[email protected].10
[email protected].11
[email protected].10
[email protected].11
[email protected].8
[email protected].6
[email protected].6_1
[email protected].11_1
[email protected].12
[email protected].12_1
[email protected].12
[email protected].9
[email protected]
[email protected].9
[email protected].9
[email protected].5
[email protected].7
[email protected].8
[email protected].11
[email protected].10
[email protected].10
[email protected].7
[email protected].8
[email protected].9
[email protected].12
[email protected]
[email protected].12
[email protected].13_1
mdg:[email protected]
[email protected].14
[email protected].15_1
[email protected]
[email protected].11
[email protected].11
[email protected].16
[email protected].12_1
[email protected].12_1
[email protected].17
[email protected]
[email protected]
[email protected].1
[email protected].3
[email protected].7
[email protected].4
[email protected].43
[email protected].11
[email protected].7
ostrio:[email protected].2
ostrio:files@1.5.1
promise@0.6.7
[email protected].4
[email protected].4_1
[email protected].9_1
[email protected].5
[email protected].44_1
[email protected].12
[email protected].8
ostrio:[email protected].4
ostrio:files@1.6.0
promise@0.7.2_1
raix:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]_1
[email protected]_1
[email protected]_1
[email protected]
[email protected].13
[email protected].14
[email protected]
[email protected].8
[email protected].9
[email protected].8
[email protected].9
[email protected].10
[email protected].9_1
[email protected]
Loading

0 comments on commit 18de999

Please sign in to comment.