Docs: Add example for parsing files
See original GitHub issueHey guys,
I’ve been consulting the documentation and the web for a proper solution to parse file arguments from a post request using webargs
, but still couldn’t find an answer to my question.
The docs says you can use the files
location during parsing but mentions no straightforward solution on which field to use for files?
Can you include an example in the docs for this one, if it’s possible to do at all?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:12 (3 by maintainers)
Top Results From Across the Web
ParseFile - Documentation
A Parse.File is a local representation of a file that is saved to the Parse cloud ... 4. a File object selected with...
Read more >Use Markdown in Google Docs, Slides, & Drawings
You can use Markdown to quickly add formatting elements to your Google Docs, Slides, and Drawings. With Markdown, you can format text to...
Read more >Build an interface to parse text from any type of document
In this example, we're calling the parse method in a loop with paths to txt, docx, pdf, html, and pptx files, and printing...
Read more >Extract the text from a document | Google Docs
The following sample uses recursion to visit each structural element in a document and prints the text. You'll need to have a project...
Read more >Send a processing request | Document AI
Batch processing. Batch (asynchronous) requests let you send multiple documents in a single request. Document AI responds with an operation that you ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you use
fields.Field
, marshmallow won’t do any processing on the value, so you’ll get a framework-specific file wrapper object. For example, you’ll get a FileStorage object in Flask.I found the problem I put location in wrong place, it should be put as second arg of use_kwargs:
@use_kwargs({"file": fields.Field(validate=lambda file: "zip" == file.filename.split(".")[-1].lower(), required=True)}, location="files")