+
Skip to content

googolgl/go_http_files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go_http_files

Easy http file server that allows to upload/download files. For images server can create thumbnail on default size 300x200.

You can send files using different ways.

First

Use curl command:

curl -F "uploadFile=@/my/dir/image.jpeg" -F "pathFile=test" http://localhost:8081/upload

Second

From html form:

<form enctype="multipart/form-data" action="http://127.0.0.1:8081/upload" method="post">
    <input type="file" name="uploadFile" />
    <input type="text" name="pathFile" />
    <input type="submit" value="upload" />
</form>

Response on request in JSON format:

{
    "url":"http://127.0.0.1:8081",
    "mime":"image/jpeg",
    "original":{
        "name":"1.jpg",
        "path":"/files/test/",
        "size":273670
    },
    "thumbnail":{
        "name":"1.jpg",
        "path":"/files/test/thumbnail/",
        "size":20912
    },
    "status":"Success"}
}

About

golang easy upload & download files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载