Skip to content
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

Cannot parse multipart form without form: attributes #10

Open
emersion opened this issue Mar 26, 2016 · 3 comments
Open

Cannot parse multipart form without form: attributes #10

emersion opened this issue Mar 26, 2016 · 3 comments

Comments

@emersion
Copy link

This works:

type UploadForm struct {
    Title      string                `form:"Title"`
    TextUpload *multipart.FileHeader `form:"TextUpload"`
}

But this produces an empty struct:

type UploadForm struct {
    Title      string
    TextUpload *multipart.FileHeader
}
@unknwon
Copy link
Contributor

unknwon commented Mar 26, 2016

But this produces an empty struct:

Why should this work?

@emersion
Copy link
Author

Because it works with JSON:

type UploadForm struct {
    Title      string
    TextUpload *multipart.FileHeader
}

// is exactly the same as:

type UploadForm struct {
    Title      string `json:"Title"`
    TextUpload *multipart.FileHeader `json:"TextUpload"`
}

@unknwon
Copy link
Contributor

unknwon commented Mar 26, 2016

Please dump your code and POST data here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants