# fileuploadbase64

> This module will take a Base64 encoded image and write the image to the filesystem. It will return the same file structure as fileupload.

Latest version **0.0.5** (published 2012-08-27) · 0 weekly downloads

## Install

```sh
npm install fileuploadbase64
pnpm add fileuploadbase64
yarn add fileuploadbase64
bun add fileuploadbase64
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2012-08-27 |
| First published | 2012-08-27 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4.6 < 0.7.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | luis Elizondo |
| Maintainers | luiselizondo |
| Keywords | fileupload, base64, express |

## Links

- npm: https://www.npmjs.com/package/fileuploadbase64
- Repository: https://github.com/lelizondo/fileuploadbase64
- npm.io page: https://npm.io/package/fileuploadbase64

## Dependencies (2)

- [mime](https://npm.io/package/mime.md) >=1.2.5
- [async](https://npm.io/package/async.md) >= 0.1.9 < 0.2.0

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2012-08-27
- 0.0.4 — 2012-08-27
- 0.0.3 — 2012-08-27
- 0.0.2 — 2012-08-27
- 0.0.1 — 2012-08-27

## README

This small module is based on https://github.com/domharrington/fileupload

The main reason was not to replace fileupload but to complement it. File upload works great and is one of the easiest modules to upload files, specially when used with Express JS

This module will take a Base64 encoded image and write the image to the filesystem. It will return the same file structure as fileupload. I did this because I'm using fileupload and I needed the result object to look the same to avoid handling different result objects.

# Install
npm install fileuploadbase64

# Usage
var fileuploadbase64 = require("fileuploadbase64");

Params:
file = the string from the encoded image
directory = destination directory to save files, don't add / at the end

Example:

var directory = './public/files';
fileuploadbase64(file, directory, function(error, result) {
  // do something with the result file object
});

## File object
The file object will be something like:

{
   size: 3909,
   type: 'image/png',
   path: 'b36e7d8a26e5dac9be9d9a5ad76cedb5/',
   basename: 'test1.png'
}

### Limitations
Right now it is hard-coded into the module the image extension, it will only create PNG files.

### License
GNU Public License Version 3
http://www.gnu.org/copyleft/gpl.html

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