Cloudflare DevelopersCD
Cloudflare Developers3y ago
4 replies
noctate

sid 3835 no im using module helper for

@sdnts no im using module helper for S3 in elixir
config = %{
      region: @s3_region,
      access_key_id: System.fetch_env!("AWS_ACCESS_KEY_ID"),
      secret_access_key: System.fetch_env!("AWS_SECRET_ACCESS_KEY")
    }


     {:ok, fields} = SimpleS3Upload.sign_form_upload(config, @s3_bucket,
      key: filename(entry),
      content_type: entry.client_type,
      max_file_size: socket.assigns.uploads[entry.upload_config].max_file_size,
      expires_in: :timer.hours(1)
      )

      metadata = %{
        uploader: "S3",
        key: filename(entry),
        url: @s3_url,
        fields: fields
      }
i thought that it will work as well with the s3 compat api, it sends
xhr.open("POST", url, true)
    xhr.send(formData)
request
Was this page helpful?