lundi 2 février 2015

AmazonS3Exception occurs accessing S3FileInfo properties

I am trying to access Amazon S3 file properties such as "Exists", "Length", "LastWriteTime", etc...with AWS .NET SDK in VS2010.


I am getting a list of files within a directory using:



S3DirectoryInfo directory = new S3DirectoryInfo(client, bucket, key);
S3FileInfo[] fileList = directory.GetFiles();


fileList is now an array of S3FileInfo objects. However, when I look at the object, all of the file properties have an exception listed, instead of the property. The exception is an AmazonS3Exception, Forbidden 404 from the server. I can do the same thing with a directory listing and get the properties for directories, but file properties are always forbidden. Just in case the issue was with the directory.GetFiles() method, I also tried to creating a single S3FileInfo using: S3FileInfo fileInfo = new S3FileInfo(client, bucket, key;


The results are the same. I know the client, bucket and key are fine, as I use them for all sorts of other operations with success, it just S3FileInfo that is having issues.


I am running a MVC 2 web application, in Visual Studio 2010, running version 2.3.18.0 of the AWS .NET SDK, with Windows 7 Professional.


Aucun commentaire:

Enregistrer un commentaire