Esempio n. 1
0
        string GetImageUrl(string fileName)
        {
            AzureFileSystemProvider provider = new AzureFileSystemProvider("");

            provider.AccountName   = "arailproject";
            provider.ContainerName = "projectattachments";
            FileManagerFile file = new FileManagerFile(provider, fileName);

            FileManagerFile[] files = new FileManagerFile[] { file };
            return(provider.GetDownloadUrl(files));
        }
Esempio n. 2
0
        string GetFileUrl(string fileName, string accountName, string containerName, ref string FileExtn)
        {
            AzureFileSystemProvider provider = new AzureFileSystemProvider("");

            provider.AccountName   = accountName;
            provider.ContainerName = containerName.ToLower();

            FileManagerFile file = new FileManagerFile(provider, fileName);

            FileExtn = file.Extension;
            FileManagerFile[] files = new FileManagerFile[] { file };
            return(provider.GetDownloadUrl(files));
        }
Esempio n. 3
0
        string GetFileUrl(string fileName, string accountName, string containerName, ref string FileExtn)
        {
            // AzureFileSystemProvider provider = new AzureFileSystemProvider("");
            // provider.AccountName = accountName;
            // provider.ContainerName =containerName.ToLower();

            // //get the storage account.
            // CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
            //     System.Configuration.ConfigurationManager.AppSettings["rcx_AzureStorageConnectionString"]);

            // //blob client now
            // CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

            // //the container for this is companystyles
            // CloudBlobContainer container = blobClient.GetContainerReference(containerName);

            // //Create a new container, if it does not exist
            //// container.CreateIfNotExists(); ;



            // FileManagerFile file = new FileManagerFile(provider, fileName);

            // FileExtn = file.Extension;
            // FileManagerFile[] files = new FileManagerFile[] { file };

            // return provider.GetDownloadUrl(files);

            AzureFileSystemProvider provider = new AzureFileSystemProvider("");

            provider.AccountName   = accountName;
            provider.ContainerName = containerName.ToLower();
            provider.BlobEndpoint  = ConfigurationManager.AppSettings["BlobEndpoint"].ToString();

            FileManagerFile file = new FileManagerFile(provider, fileName);

            FileExtn = file.Extension;
            FileManagerFile[] files = new FileManagerFile[] { file };
            return(provider.GetDownloadUrl(files));
        }