1.1.4 • Published 6 years ago

f-send v1.1.4

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

Send a file to server

Install:

    npm i f-send --save

Usage: 1) import into service o component

import { fileSend } from "fileSend";

2) inject in the constructor

construct( private _fs:fileSend  ){}

3) usage:

    _fs.send( File, "http://localhost:4002/upload" , "PUT" ,"imagen", true  )
            .then( r =>{
                console.log(r) // server response 
            });

'State' property returns the state an XMLHttpRequest

ValueDescription
0Client has been created. open() not called yet.
1XmlHttpRequest.open() has been called.
2XmlHttpRequest.send() has been called, and headers and status are available.
3Downloading; responseText holds partial data.
4The operation is complete.
    let percentage:number;
    percentage = _fs.State * 25;
    // 1 => 25% 
    // 2 => 50% 
    // 3 => 75%
    // 4 => 100%
1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago