Upload to specific Folder in S3

Hi,

I’m trying to associate my users with their uploaded files.
Therefore setting the absolute path for S3 storage with a syntax similar to: “custom_value/filename” would be great.

Is there a possibility of implementing this?

As far as I understood the “pattern” param is resticted to (${default}, ${auto_filename}, ${effects}, ${filename}, ${uuid}, ${ext}).

Greetings
Jonas

Jonas,

${something} are placeholders that are populated with file metadata.
Currently, to save files in S3 to corresponding “folders” you can override the pattern during explicit copy request, e.g.

curl -X POST \
     -H "Authorization: Uploadcare.Simple demopublickey:demoprivatekey" \
     -d "source=03ccf9ab-f266-43fb-973d-a6529c55c2ae" \
     -d "target=mytarget" \
     -d "pattern=customer123/${auto_filename}" \
     "https://api.uploadcare.com/files/"

So, depending on who uploaded the file (presuming your app knows it), you change customer123 to customer321 etc.

1 Like