How Do I dowload a file from Amazon S3?
6 次查看(过去 30 天)
显示 更早的评论
Hello,
I am trying to use matlab to download a .gz file from Amazon s3. I have the AWS creditials set.
% Set AWS credentials
YOUR_AWS_ACCESS_KEY_ID = 'test1';
YOUR_AWS_SECRET_ACCESS_KEY = 'test2';
setenv('AWS_ACCESS_KEY_ID', YOUR_AWS_ACCESS_KEY_ID);
setenv('AWS_SECRET_ACCESS_KEY', YOUR_AWS_SECRET_ACCESS_KEY);
setenv('AWS_REGION', 'us-west-2');
I have my path s3 path:
rawdataPath = 's3://companya/Frontier/FieldData/file.csv.gz'
I am wondering how I can download this file.
0 个评论
回答(1 个)
Voss
2024-3-18
Once you have your environment set up, you should be able to treat files on S3 as you would treat any local file, e.g.,
rawdataPath = 's3://companya/Frontier/FieldData/file.csv.gz'
localDir = 'C:\Downloads';
% copy .gz to local directory:
copyfile(rawdataPath,localDir)
% or unzip .gz to local directory:
gunzip(rawdataPath,localDir)
2 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Programming Utilities 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!