Skip to content

Conversation

@awnzl
Copy link
Collaborator

@awnzl awnzl commented Feb 18, 2025

This provides the requested feature for the model in the request.

Further enhancement of this feature in this CMS requires some clarification, a plenty of efforts.

Currently, this handler able to hand only one use case (there is a hardcoded field name for foreign key, it's a significant restriction). To make it general, we have to understand how a foreign key with multiple fields should be stored in a CSV file and described in/as a model to have a way to find it in the DB during handling.


// CSVImporterHandler handles CSV files
func CSVImporterHandler(w http.ResponseWriter, r *http.Request, session *Session) {
if err := r.ParseMultipartForm(32 << 20); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls add comments/description why to use 32 << 20 - sounds like magic

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 32 Mb. I just use the same approach I see everywhere in uadmin...

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants