简体   繁体   English

如何从Rails应用程序将文件从一个文件夹复制到同一AWS S3存储桶中的另一个文件夹?

[英]How do I copy a file from one folder to another folder in same aws s3 bucket from a rails application?

I need to copy a file from one folder to another folder with new name in same aws S3 bucket. 我需要将一个文件从一个文件夹复制到另一个文件夹,并且在相同的aws S3存储桶中使用新名称。 Can anyone have idea how I do it with aws-sdk gem or something else? 任何人都可以知道我如何使用aws-sdk gem或其他方法吗?

bucket = Aws::S3::Bucket.new('bucketname')

new_object = bucket.object('new_key')
aws_response = new_object.copy_from(bucket.object('source_key'))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将文件从一个Rails应用程序复制到AWS EC2实例 - How do I copy a file from one rails application to aws ec2 instance 如何在Rails中将图像从一个文件夹传输到另一个文件夹。 (图像已上传到s3服务器上) - How to transfer images from one folder to another in rails. (images are uploaded on s3 server) Ruby on Rails:如何将所有文件从一个文件夹移动到另一个文件夹? - Ruby on Rails: How do I move all files from one folder to another folder? Refinerycms:将文件从一个AWS S3存储桶迁移到另一个后丢失的文件名 - Refinerycms: file names lost after migrating files from one AWS S3 bucket to another 如何使用rails应用程序中的s3在存储桶之间复制文件? - How do I copy files between buckets using s3 from a rails application? 如何使用 AWS SDK(Ruby on Rails)将文件从 S3 存储桶直接下载到浏览器? - How to download a file from S3 bucket directly to the browser using AWS SDK (Ruby on Rails)? 将文件夹上传到 Rails 中的 S3 存储桶 - Upload a Folder to S3 bucket in Rails Rails 4,Fog,Amazon s3-从存储桶中的特定文件夹中以阵列形式检索所有图像。 - Rails 4, Fog, Amazon s3 - retrieving all the images as an array from a specific folder in a bucket. Rails AWS S3:下载文件并存储在临时文件夹中 - Rails AWS S3: Downloading File and Storing in Temp Folder 从 AWS S3 Bucket 获取数据文件并在 Rails 中解析? - Getting a datafile from AWS S3 Bucket and parse in Rails?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM