-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upload image processing using gin #107
Comments
no, but the http package include an powerful API to handle multipart requests. Do you think we should add a higher API in gin.Content? |
@manucorporat Add this feature is cool. but is better to be a middleware. |
@johndeng I agree |
@manucorporat Thanks. |
How are you supposed to handle file uploads in Gin, then? I can't seem to access FormFile from Context: [GIN] 2014/09/01 - 03:48:13 | 400 | 248.788us | 172.4.231.9 POST /post |
Oh nevermind it was an issue with binding. If it helps the OP this is how you handle multipart forms: c.Request.FormValue("value") |
Hmm, i realize that there are many ways to do this. // the not so optimized way. another option is to perform the basic upload image using the optimized buffer method |
I don't think Middleware is the best option for this kind of stuff, sometimes you want to process the data or save the file, etc... but files sometimes are optional, its too broad of a use case. What would be pretty useful is a simple function within Gin that takes the current context and saves the file to disk given a route (and handles all temp file and copy for the user). You can perform validations and such before, and just save it if needed. |
dont know what's the plan for the image upload .i am trying to do as above and use c.Request.Formfile("image") ,which may not so convinence. |
I use the following stuff, just like @badoet suggested and it works super fine.
|
@nazwa and your settings detail? |
Anything you want really. In my case it's
|
@nazwa thankyou |
do gin have a feature to handle multipart form post upload?
The text was updated successfully, but these errors were encountered: