# f-send

> Send a file to server

Latest version **1.1.4** (published 2018-10-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install f-send
pnpm add f-send
yarn add f-send
bun add f-send
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2018-10-31 |
| First published | 2018-10-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | holgado.m |

## Links

- npm: https://www.npmjs.com/package/f-send
- npm.io page: https://npm.io/package/f-send

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) ^10.12.1

## Recent versions

- 1.1.4 (latest) — 2018-10-31
- 1.1.3 — 2018-10-31
- 1.1.2 — 2018-10-31
- 1.1.1 — 2018-10-31
- 1.1.0 — 2018-10-30
- 1.0.0 — 2018-10-30

## README

# Send a file to server

Install: 
```sh
    npm i f-send --save
```

Usage:
1) import into service o component

```sh
import { fileSend } from "fileSend";
```

2) inject in the constructor
```sh
construct( private _fs:fileSend  ){}
```
3) usage:

```sh
    _fs.send( File, "http://localhost:4002/upload" , "PUT" ,"imagen", true  )
            .then( r =>{
                console.log(r) // server response 
            });
```
'State' property returns the state an XMLHttpRequest

| Value | Description |
| ------ | ------ |
| 0 | Client has been created. open() not called yet. |
| 1 | XmlHttpRequest.open() has been called. |
| 2 | XmlHttpRequest.send() has been called, and headers and status are available. |
| 3 | Downloading; responseText holds partial data. |
| 4 | The operation is complete. |

```sh
    let percentage:number;
    percentage = _fs.State * 25;
    // 1 => 25% 
    // 2 => 50% 
    // 3 => 75%
    // 4 => 100%
```

---
_Source: https://npm.io/package/f-send · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
