Changing UploadedFile to not always write to disk #1640
Unanswered
refi64
asked this question in
Feature requests & Ideas
Replies: 1 comment 6 replies
-
@refi64 Could I ask for some examples of how other frameworks do what you're looking for. I think get what you're asking for, but I want to make sure we land on a good solution that makes sense to everyone involved. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now
Lucky::UploadedFile
always saves the content to a temporary file before control is passed into the application. This has a few issues:Now, here's my idea:
UploadedFile
doesn't actually save the file yet, the constructor just takes the given IO value and saves it. Then, a new method.save
is added that will save it to disk and return theFile
instance, and another method.content
/.body
is added to return the IO stream. (.path
would also have to be removed.) That way, if someone really needs it on disk, they can easily change their code, but anyone who can handle the direct stream doesn't need to save to disk first.Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions