Skip to content

Commit

Permalink
Add text to object metadata. (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaddox5 authored Aug 27, 2024
1 parent 54f45f7 commit 3363946
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/web_api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ defmodule WebApi do
# Copy the object to itself, which updates the timestamp, so we only expire files
# that haven't been used in a while
{:ok, _} =
ExAws.S3.put_object_copy(bucket, key, bucket, key, metadata_directive: :REPLACE)
ExAws.S3.put_object_copy(bucket, key, bucket, key,
metadata_directive: :REPLACE,
meta: [{:text, text}]
)
|> ExAws.request()

conn
Expand All @@ -51,7 +54,10 @@ defmodule WebApi do
conn = send_resp(conn, 200, audio)

{:ok, _} =
ExAws.S3.put_object(bucket, key, audio, content_type: "audio/mpeg")
ExAws.S3.put_object(bucket, key, audio,
content_type: "audio/mpeg",
meta: [{:text, text}]
)
|> ExAws.request()

conn
Expand Down

0 comments on commit 3363946

Please sign in to comment.