1. Matthew Frazier
  2. flask-uploads
  3. Pull requests

Pull requests

#1 Declined

Implemented saving to stream

  1. Christopher Grebs

Implemented the ability to save a stream (file like objects) so that the application is able to append to existing files.

Things to note:

  • Changed name to destination argument to clarify it's usage
  • conflict resolution is definitely disabled if a user passes a stream object as we would have to predict what the user wants to do and we cannot.

Comments (1)

  1. Matthew Frazier repo owner

    While I appreciate the quality of the code and the documentation you provided, I'm not 100% sure what concrete benefits this gives in terms of Flask-Uploads' design. If you need to save something to a stream, you can do so already using FileStorage.save, without invoking Flask-Uploads at all -- and since this completely bypasses most of the logic for deciding where a file needs to go, I don't see a reason to invoke Flask-Uploads besides extension validation (which you can do with UploadSet.extension_allowed).

    So, rejected for now. Though if you can provide a concrete use case that this simplifies compared to calling FileStorage.save on the stream yourself, the code itself is good enough to merge. (Also, sorry that it took so long to respond...I've been pretty busy with work and school lately.)