keichan34 / exfile

File upload persistence and processing for Phoenix / Plug
MIT License
90 stars 19 forks source link

(Ecto.FileTemplate) Save file to cache backend when cast, make uploading explicit #31

Closed keichan34 closed 8 years ago

keichan34 commented 8 years ago

See #30

Because uploading should occur after validations, etc, occur, it shouldn't be uploaded as part of the cast step.

Ecto doesn't have callbacks, so a upload function will have to be called after ecto save succeeded.

keichan34 commented 8 years ago

This is a pretty major bug because it means that images will be uploaded to the backend even if the Ecto struct fails to save due to some other validation or database error.