We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to create an image programmatically, but the image being uploaded on AWS S3 bucket is becoming as 0KB, so no image is being uploaded.
Any clue?
This is the code:
if (imageBytes != null & imageBytes.Any()) { var imageAsIMedia = mediaService.CreateMedia(item.title, new Guid(Constants.Constants.CommunityItemsFolderGuId), global::Umbraco.Core.Constants.Conventions.MediaTypes.Image); using (Stream stream = new MemoryStream(imageBytes)) { var imageFromStream = Image.FromStream(stream); var imageFormat = ImageHelpers.GetImageFormat(imageFromStream); imageAsIMedia.SetValue(Services.ContentTypeBaseServices, "umbracoFile", item.title + imageFormat, stream); var imageSaveResult = mediaService.Save(imageAsIMedia); if (imageSaveResult.Success) { request.SetValue(Constants.Constants.CommunityItemPhotoAlias, imageAsIMedia.GetUdi()); var mediaAsIPublishedContent = Umbraco.Media(imageAsIMedia.Id); imageUrl = mediaAsIPublishedContent.Url(null, UrlMode.Absolute); } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am trying to create an image programmatically, but the image being uploaded on AWS S3 bucket is becoming as 0KB, so no image is being uploaded.
Any clue?
This is the code:
The text was updated successfully, but these errors were encountered: