GetObject() public method

Get an object. The object will be streamed to the callback given by the user.
public GetObject ( string bucketName, string objectName, Action callback ) : void
bucketName string Bucket to retrieve object from
objectName string Name of object to retrieve
callback Action A stream will be passed to the callback
return void
Ejemplo n.º 1
0
        static int Main(string[] args)
        {
            var client = new MinioClient("https://s3.amazonaws.com", "ACCESSKEY", "SECRETKEY");

            client.GetObject("bucketName", "objectName", (stream) =>
            {
                stream.CopyTo(Console.OpenStandardOutput());
            });

            return 0;
        }
Ejemplo n.º 2
0
        static int Main(string[] args)
        {
            var client = new MinioClient("https://s3.amazonaws.com", "ACCESSKEY", "SECRETKEY");

            client.GetObject("bucket", "object", (stream) =>
            {
                byte[] buffer = new byte[10];
                stream.Read(buffer, 0, 10);
            });

            return 0;
        }
Ejemplo n.º 3
0
        static int Main()
        {
            /// Note: s3 AccessKey and SecretKey needs to be added in App.config file
              /// See instructions in README.md on running examples for more information.
            var client = new MinioClient("s3.amazonaws.com", ConfigurationManager.AppSettings["s3AccessKey"],
                                         ConfigurationManager.AppSettings["s3SecretKey"]);

            client.GetObject("my-bucketname", "my-objectname", (stream) =>
            {
                stream.CopyTo(Console.OpenStandardOutput());
            });

            return 0;
        }