Skip to content

Commit

Permalink
Docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-dimitru committed Aug 20, 2016
1 parent bccbd14 commit d5dbd05
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 8 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
[![Twitter](https://img.shields.io/twitter/url/https/github.com/VeliovGroup/Meteor-Files.svg?style=social)](https://twitter.com/intent/tweet?url=https%3A%2F%2Fgithub.com%2FVeliovGroup%2FMeteor-Files)
[![Codewake](https://www.codewake.com/badges/codewake2.svg)](https://www.codewake.com/p/meteor-files)

#### Please see our experimental [webrtc-data-channel](https://github.com/VeliovGroup/Meteor-Files/tree/webrtc-data-channel) branch. Feedback is highly appreciated!

ToC:
========
- [Wiki](https://github.com/VeliovGroup/Meteor-Files/wiki) - Full documentation
Expand Down Expand Up @@ -74,7 +76,7 @@ Related Packages:
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, [read about difference](https://github.com/VeliovGroup/Meteor-Files/wiki/About-Upload-Transports)
- Support for `HTTP`, [RTC/DC](https://github.com/VeliovGroup/Meteor-Files/tree/webrtc-data-channel) and `DDP` transports for upload, [read about difference](https://github.com/VeliovGroup/Meteor-Files/wiki/About-Upload-Transports)
- 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)*, *[Google Storage](https://github.com/VeliovGroup/Meteor-Files/wiki/Google-Cloud-Storage-Integration)* or *[DropBox](https://github.com/VeliovGroup/Meteor-Files/wiki/DropBox-Integration)*? (*[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](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*
Expand Down Expand Up @@ -305,6 +307,7 @@ For more expressive example see [Download demo](https://github.com/VeliovGroup/M
Supporters:
========
I would like to thank everyone who support this project. *Because of those guys this project can have 100% of our attention*.
- [@Neobii](https://github.com/Neobii)
- [@themeteorchef](https://github.com/themeteorchef)
- [@MeDBejoHok](https://github.com/medbejohok)
- [@martunta](https://github.com/martunta)
Expand Down
18 changes: 16 additions & 2 deletions docs/about-transports.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The pros:
The cons:

- “magic” overhead inside DDP and EJSON;
- Only one data-transfer per time unit;
- Only one data-transfer per time unit (*blocks other DDP requests, like methods, subs, etc.*);
- It's synchronous.

#### HTTP (TCP/IP)
Expand All @@ -32,4 +32,18 @@ The cons:


#### RTC Data Chanel (UDP)
*We're working on it*
This transport supported only in [webrtc-data-channel](https://github.com/VeliovGroup/Meteor-Files/tree/webrtc-data-channel) branch. It's in testing mode, we're waiting for community feedback, before merging to `master`. If you're interested in RTC/DC uploads, try this branch locally. Any feedback on RTC/DC usage for uploads is highly appreciated!

The pros:

- Single socket connection;
- Direct tunneled connection from Client to Server;
- Pure binary data support;
- Native implementation and support on mobile devices;
- It's UDP.

The cons:

- No mobile browsers support;
- Chunk size limited to 64KB;
- Only single stream is supported (*so, it's currently uses synchronous chunk uploads*. If `RTC/DC` will be accepted by community we will implement asynchronous chunks upload).
22 changes: 18 additions & 4 deletions docs/insert.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##### `insert(settings[, autoStart])` [*Client*]
*Upload file to Server via DDP.*
*Upload file to Server via DDP, [RTC/DC](https://github.com/VeliovGroup/Meteor-Files/tree/webrtc-data-channel) or HTTP.*

<table>
<thead>
Expand Down Expand Up @@ -126,7 +126,7 @@
Callback, triggered after chunk is sent<br />
<strong>Arguments</strong>:
<ul>
<li><code>progress</code> {<em>Number</em>} - Current progress from `0` to `100`</li>
<li><code>progress</code> {<em>Number</em>} - Current progress from <code>0</code> to <code>100</code></li>
<li><code>fileData</code> {<em>Object</em>}</li>
</ul>
</td>
Expand Down Expand Up @@ -281,6 +281,18 @@
</td>
<td></td>
</tr>
<tr>
<td align="right">
<code>pipe()</code> {<em>Function</em>}
</td>
<td>
Pipe data before upload
</td>
<td>
All data must be in <code>data URI</code> scheme (*Base64*)<br />
Only for <code>webrtc</code> transport data represented as <code>ArrayBuffer</code>.
</td>
</tr>
<tr>
<td align="right">
<code>estimateTime</code> {<em>ReactiveVar</em>}
Expand Down Expand Up @@ -321,7 +333,7 @@
</tbody>
</table>

### Event map:
### Events map:
<table>
<thead>
<tr>
Expand Down Expand Up @@ -387,7 +399,7 @@
Triggered after each chunk is sent.<br />
<strong>Arguments</strong>:
<ul>
<li><code>progress</code> {<em>Number</em>} - Current progress from `0` to `100`</li>
<li><code>progress</code> {<em>Number</em>} - Current progress from <code>0</code> to <code>100</code></li>
<li><code>fileData</code> {<em>Object</em>}</li>
</ul>
</td>
Expand Down Expand Up @@ -609,6 +621,8 @@ Template.uploadForm.events({
```

##### Piping:
Note: data flow in `webrtc` transport uses ArrayBuffer, while `ddp` and `http` uses dataURI (*Base64*). `webrtc` is available only on [webrtc-data-channel](https://github.com/VeliovGroup/Meteor-Files/tree/webrtc-data-channel) branch.

```javascript
var encrypt = function encrypt(data) {
return someHowEncryptAndReturnAsBase64(data);
Expand Down
3 changes: 2 additions & 1 deletion docs/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ Meteor-Files
</tbody>
</table>

Please see our experimental [webrtc-data-channel](https://github.com/VeliovGroup/Meteor-Files/tree/webrtc-data-channel) branch. Feedback is highly appreciated!

### About:
- Event-driven API
- Upload / Read files in Cordova app: __Cordva support__ (Any with support of `FileReader`)
- Upload via *HTTP* or *DDP*, [read about difference](https://github.com/VeliovGroup/Meteor-Files/wiki/About-Upload-Transports)
- Upload via *HTTP*, [*RTC/DC*](https://github.com/VeliovGroup/Meteor-Files/tree/webrtc-data-channel) or *DDP*, [read about difference](https://github.com/VeliovGroup/Meteor-Files/wiki/About-Upload-Transports)
- File upload:
* Ready for small and large files (RAM used only for chunk reading - [read about `chunkSize`](https://github.com/VeliovGroup/Meteor-Files/wiki/Insert-(Upload)))
* Pause / Resume upload
Expand Down

0 comments on commit d5dbd05

Please sign in to comment.