Skip to content

Pass binary to cast_attachments #54

@darkbaby123

Description

@darkbaby123

There's a referenced issue in arc but I think it's arc_ecto's responsibility so I create an issue here.

My requirement is uploading file as base64 encoded string to the server. It's common for small files and is easy to work with JSON API. After googling I found arc support binary, so I thought I can decode base64 to binary and save the file.

arc support passing binary like this Avatar.store(%{filename: "file.png", binary: binary}) but there's no way to pass binary in arc_ecto, The cast_attachments(%{filename: "file.png", binary: binary}) fails. I checked the source and it seems the arc_ecto only support Plug.Upload struct. Is there a way or workaround to achieve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions