public Picture GetPicture(string name)
 {
     CloudBlob blob = blobContainer.GetBlobReference(name);
     Picture retVal = new Picture();
     retVal.Name = name;
     retVal.PictureStream = blob.DownloadByteArray();
     return retVal;
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            //string filePath = @"C:\Users\Public\Pictures\Sample Pictures\desert.jpg";
            string filePath = @"C:\wcftest\test.txt";

            Picture pictureToUpload = new Picture();
            //pictureToUpload.Name = "desert.jpg";
            pictureToUpload.Name = "test.txt";
            pictureToUpload.PictureStream =  File.ReadAllBytes(filePath);

            PictureServiceClient client = new PictureServiceClient();
            client.UploadPicture(pictureToUpload);
        }
 public void UploadPicture(Picture picture)
 {
     CloudBlob blob = blobContainer.GetBlobReference(picture.Name);
     blob.UploadByteArray(picture.PictureStream);
 }