Waffle.Actions.Delete (waffle v1.1.7)

Delete files from a defined adapter.

After an object is stored through Waffle, you may optionally remove it. To remove a stored object, pass the same path identifier and scope from which you stored the object.

# Without a scope:
{:ok, original_filename} = Avatar.store("/Images/me.png")
:ok = Avatar.delete(original_filename)

# With a scope:
user = Repo.get!(User, 1)
{:ok, original_filename} = Avatar.store({"/Images/me.png", user})
# example 1
:ok = Avatar.delete({original_filename, user})
# example 2
user = Repo.get!(User, 1)
:ok = Avatar.delete({user.avatar, user})

Link to this section Summary

Link to this section Functions

Link to this function

delete(definition, filepath)