Add option to overwrite UploadFile impl
See original GitHub issueIn our case we’re streaming in-flight uploaded files directly to MongoDB GridFS,
so if we lose/crash some asgi worker process that is actually using the uploaded yet unprocessed file, a schedule job can detect this and resume operation. With SpooledTemporaryFile
this is impossible because we can’t guarantee that resume job will land in the same container.
This all works well with Starlette, only drawback is that we need to monkey-patch UploadedFile
class with our implementation, that sends chunks to Mongo’s GridFS
.
Can Startlette have UploadedFile
class configurable?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (5 by maintainers)
Top Results From Across the Web
jquery file upload - how to overwrite file NOT rename
If you using UploadHandler.php that is exists in the wiki it's simple. In the get_file_name method you should replace this line:
Read more >One Missing Step to Uncheck Overwrite Existing Files in ...
You click Upload document from the ribbon, and get the dialog box below. You have the option to “overwrite existing files” and it...
Read more >Using FileUpload - Apache Commons
The factory implementation that currently ships with FileUpload stores the item's data in memory or on disk, depending on the size of the...
Read more >Uploading and copying objects using multipart upload
Upload a single object as a set of parts independently using the multipart ... as a previously uploaded part, the previously uploaded part...
Read more >Java file upload by example with Servlets & JSPs
You will need to perform the following steps to create a Java Servlet file upload component: Create a basic HTML or JSP file...
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
Bump here from discussion https://github.com/encode/starlette/discussions/1934 - I can provide my own complex parsing, but there’s overhead that I can’t get rid of by having to read the spooled file from start to finish a second time. I hoped to be able to have starlette use a custom UploadFile subclass, as that would be a great place for us to add the logic we wanted.
Going to close this off for now with the same justification as https://github.com/encode/starlette/issues/849
Out of scope. If ya need more complex parsing than we currently provide, you need to do so within your own project.