lordfriend / fileUploader

An example using formidable to upload file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A example server using formidable to upload files.

##End Point

###/upload

POST

upload file to this end point with POST method and content-type of multipart/form-data

respond a json object contains file url. e.g.

{
    "url": "http://example.com/file/hash-123456asdfghjkl"
}

###/simple/upload

PUT

upload file to this end point with PUT method. no other format requirement.

respond a json object contains file url. e.g.

{
    "url": "http://example.com/file/hash-123456asdfghjkl"
}

###/list-files

GET

respond an array of files

[
    {"url": "http://example.com/file/hash-123456asdfghjkl"},
    {"url": "http://example.com/file/hash-8765120adfloewo"},
    // and more ....
]
``

###/file/:filename

`GET`

respond a file with given filename.

##Page:

###/

upload a file through web page

###/list

browse uploaded files.

About

An example using formidable to upload file


Languages

Language:JavaScript 46.4%Language:C 40.4%Language:HTML 12.4%Language:CSS 0.9%