Skip to content

zupzup/warp-upload-download-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

warp-upload-download-example

Example of Upload and Download in Rust using Warp

Run with cargo run. This starts a server at http://localhost:8080 with two routes:

  • POST /upload - you can upload a file here
  • GET /files/* - download the uploaded files

Example upload request:

curl --location --request POST 'http://localhost:8080/upload' \
--header 'Content-Type: multipart/form-data' \
--form 'file=@/home/somewhere/picture.png'

The file is saved using a random id as a name, with the extension. The name is logged, so you can see that it worked.

The max file-size is configured at ~5 MB.

About

Example of Upload and Download in Rust using Warp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published