I've seen in documentation in Body section that there's a support for file uploading right now - or at least I understand it this way
相关问题
- How to upload images from the browser to Amazon S3
- Vapor 2 Validation Valid-Type throws “Use of undec
- Deploying Vapor with heroku
- Vapor Installation Issues (First time using Vapor)
- How do I download a file and send a file using Vap
相关文章
- Uploading files using Vapor
- Using vapor-fluent to upsert models
- Validate JWT token with RS256 or RS512 with Swift
- Vapor upload multiple files at once
- How to handle multipart request with Vapor 3
- How do I read this Swift syntax? [duplicate]
- How to send a POST request to Firebase Cloud Messa
- How to create a model in vapor using Mongokitten
Vapor allows for file upload using the Multipart encoding. You can read more about HTTP upload here:
How does HTTP file upload work?
And also here:
What does enctype='multipart/form-data' mean?
So the HTML code to upload a file to Vapor would look something like:
And then the code in Vapor
In terms of how to store the image, that is up to you. You can store in a database or create a folder on the system to which you have write access.