Skip to content

Commit

Permalink
doc: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
pemrouz committed Aug 5, 2016
1 parent d19a416 commit 39d0a4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Coverage Status](https://coveralls.io/repos/rijs/upload/badge.svg?branch=master&service=github)](https://coveralls.io/github/rijs/upload?branch=master)
[![Build Status](https://travis-ci.org/rijs/upload.svg)](https://travis-ci.org/rijs/upload)

This module makes uploading forms nicer to deal with. In particlar, it turns `type="file"` elements into a native Stream (with backpressure and all) on the server-side so you can then simply pipe them.
This module aims to make uploading forms nicer to deal with. Given a `<form>`, you can get a sensible JSON object on the server side where the keys are the `[name]` attribute of each control. In particlar, it turns `type="file"` elements into an array of native Streams (with backpressure and all) so you can then simply pipe them.

First, use [utilise/form](https://github.com/utilise/utilise#--form) to turn your form element into a simple plain JSON object.

Expand All @@ -18,7 +18,7 @@ ripple.upload('resource', values)
.on('progress', response => ...)
```

The `resource` identifies which handler to use on the server-side. For example, let's say you registered an `events` resource, then its `from` function would receive the upload. Complete example:
The `resource` identifies which handler to use on the server-side. For example, let's say you registered an `events` resource, then its `from` function would receive the upload. Complete example below and [see the example/test for a real example](https://github.com/rijs/upload/blob/master/test):

```html
<form>
Expand Down

0 comments on commit 39d0a4f

Please sign in to comment.