Please help, am trying to upload file to S3 through external but each time I fire the upload I got module SimpleS3Upload is not available I don’t know what I am doing wrong below is my snippet. Kindly help me.
‘’’
uploads = socket.assigns.uploads
bucket = “tes-image”
key = “public/#{entry.client_name}”
config = %{
region: 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, bucket,
key: key,
content_type: entry.client_type,
max_file_size: uploads[entry.upload_config].max_file_size,
expires_in: :timer.hours(1)
)
meta = %{
uploader: "S3",
key: key,
url: "http://#{bucket}.s3-#{config.region}.amazonaws.com",
fields: fields
}
{:ok, meta, socket}
‘’’