In arc_ecto, why do I get a SignatureDoesNotMatch error when uploading a file from an external URL to my S3 bucket (e.g. File.upload_file(%{"attachment" => "http://sample.com/file.pdf"}) ? I already configured my File model's changeset to allow paths when casting attachments.
def changeset(struct, params \\ %{}) do
struct
|> cast(params, @required_attrs ++ @optional_attrs)
|> cast_attachments(params, [:attachment], allow_paths: true)
|> validate_required(@required_attrs)
end
In
arc_ecto
, why do I get aSignatureDoesNotMatch
error when uploading a file from an external URL to my S3 bucket (e.g.File.upload_file(%{"attachment" => "http://sample.com/file.pdf"})
? I already configured my File model's changeset to allow paths when casting attachments.If
attachment
is set as aPlug.Upload
, it works:but not if it's a URL:
File.upload_file(%{"attachment" => "http://sample.com/file.pdf"})
. Here's how I set up my uploader: