File upload/attachment/storage lib

Any recommendations for handling file attachment and storage in Elixir/Phoenix? Arc looks like the OG lib but hasn’t had much activity for almost 2 years. Waffle looks like a well marketed fork that claims the original is no longer “supported”, but I don’t see any notice to that effect.

Are folks mostly using one of those two? Rolling your own?

Manage file attachement by myself and use separate storage lib depending of the need (e.g. s3 lib).
File attachment is really easy in Phoenix.

1 Like

Please, which s3 library? Because the most known (maybe I’m wrong) is ExAws.
And it seems to be in the process of been deprecated due to lack of available maintainers.

Well Arc is no longer maintained but Waffle is. I’m using Waffle and it does his job. The documentation is not too verbose but the library is easy to use.

Of course Waffle also depends on ExAws when using S3 bucket, and I’m wondering how the things will go now that ExAws will likely be deprecated…

It will go just fine. To quote the AWS documentation:

The current version of the Amazon S3 API is 2006-03-01.

The API hasn’t had a backwards incompatible change in 14 years, at least according to its docs. ExAws deprecation is more about forward compatibility with new AWS services and less about backward compatibility with existing ones.

3 Likes

Write your code without create any coupling with your storage system. So if you want to change to another lib, you will not change any of your business stuff. In that way, you’ll be ok to use ExAws even if you think it will be deprecated.

But as said @benwilson512 aws api doesn’t break backward compatibilty. You should be ok for the next decade (or something like that).

2 Likes

I ended up rolling my own, and I decided to put it in its own lib. I’m not sure if I’ll expand it enough to merit releasing a package, but if anyone’s interested the source is on Github:

It takes a lot of inspiration from Ruby’s Shrine, but with the spirit (patterns) of Elixir. It only handles url -> local storage right now. I’ll at least be adding binary, and Plug.Upload support, probably Ecto support.

2 Likes