Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having "key is a directory name" exception

S3DirectoryInfo dir= new S3DirectoryInfo(client, "bucketname", "sampledir/sample");
test.Create();
var files = dir.GetFiles();

so using dir.GetFiles(), i can't get the files inside the directory. how can i solve this????

like image 984
Upalr Avatar asked Jun 08 '16 13:06

Upalr


1 Answers

Instead of above code use this below code it will work. The change is trailing slash.

S3DirectoryInfo dir= new S3DirectoryInfo(client, "bucketname","sampledir\sample");
    test.Create();
    var files = dir.GetFiles();
like image 91
error2007s Avatar answered Nov 03 '22 00:11

error2007s