Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
HI Guys,
I need some help/guidance here, I'm trying to upload files into Umbraco but not into the media folder but to the Azure storage Blub.
The issue: Files uploaded to Blob successfully but corrupted.
Note: Same files, blob storage, same upload function works in external project out side umbraco works fine !.!
private async Task<int> SaveCustomDetails(UserMember user, UserCustomViewModel model) { .. if (model.ProfessionalImage != null) { details.ProfessionalImage = await FilesManager.UploadAsync(model.ProfessionalImage, memberId); } } public static async Task<string> UploadAsync(HttpPostedFileBase fileToUpload, int memberId) { string fileFullPath = null; if (fileToUpload == null || fileToUpload.ContentLength == 0) { return null; } try { CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageAccountConnection"].ToString()); CloudBlobClient cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient(); CloudBlobContainer cloudBlobContainer = cloudBlobClient.GetContainerReference(memberId.ToString()); await cloudBlobContainer.CreateIfNotExistsAsync(); await cloudBlobContainer.SetPermissionsAsync( new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob } ); string fileName = fileToUpload.FileName; CloudBlockBlob cloudBlockBlob = cloudBlobContainer.GetBlockBlobReference(fileName); cloudBlockBlob.Properties.ContentType = fileToUpload.ContentType; await cloudBlockBlob.UploadFromStreamAsync(fileToUpload.InputStream); fileFullPath = cloudBlockBlob.Uri.ToString(); } catch (Exception ex) { } return fileFullPath; }
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Issue Uploading files to Azure storage blob size 0, from MVC pages surface controller
HI Guys,
I need some help/guidance here, I'm trying to upload files into Umbraco but not into the media folder but to the Azure storage Blub.
The issue: Files uploaded to Blob successfully but corrupted.
Note: Same files, blob storage, same upload function works in external project out side umbraco works fine !.!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.