https://github.com/aackerman/filestream
Streaming files to the server
https://github.com/aackerman/filestream
Last synced: 12 months ago
JSON representation
Streaming files to the server
- Host: GitHub
- URL: https://github.com/aackerman/filestream
- Owner: aackerman
- Created: 2013-02-04T02:22:37.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-02-10T19:07:21.000Z (over 13 years ago)
- Last Synced: 2024-04-15T03:02:15.680Z (about 2 years ago)
- Language: JavaScript
- Size: 159 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
filestream
==========
Sending and Streaming files from the client to the server
## Usage
```js
var promise = filestream({
el: document.getElementById('filestream'),
url: '/upload'
});
promise.then(function(){
console.log('File Uploaded!');
});
promise.progress(function(progress){
console.log(progress);
});
```
Style the filestream element as you wish and drag and drop files to upload to the server.
The element given to the `filestream` method adds a drop event to the element. When a file or files are dropped on the element the files are sent via xhr to the supplied url.
Note: Promises returned do not attempt to adhere to the Promises/A+ spec.