amazon s3 - Downloading object from S3 through rails not knowing the exact key -
i have simple rails application user can upload , download file s3. example: in /avatar/caid/uuid
, there 1 file named uuid.png
uploaded user. next, user must able download particular file s3, however, @ time, doesn't know exact name of file saved in s3. knows file save in /avatar/caid/uuid
. question how can download file /avatar/caid/uuid
folder? tried option below:
resp = s3.get_object( bucket: "xxx", key: "avatar/123/456/pic.bmp", )
however, option above assumes have know exact name of file pic.bmp
. may know how can download file pic.bmp
knowing
url" "avatar/123/456" ?
thanks
Comments
Post a Comment