Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

File upload example

Simple tinyhttp + formidable example.

Install

tinyhttp new file-upload

Run

node index.js

Then send a file (using curl or any other HTTP client):

curl -F "file=@index.js" localhost:3000/api/upload

Output should be something like this:

{
  "fields": {},
  "files": {
    "file": {
      "size": 705,
      "path": "/tmp/upload_09830274c55da0f3ffdc1d45ebe2bbe9",
      "name": "index.js",
      "type": "application/octet-stream",
      "mtime": "2020-09-08T19:36:52.735Z"
    }
  }
}