London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
Hi, maybe this is not exactly what you want (asset folder), but you should be able to define the following property:
[Display(GroupName = SystemTabNames.Content, Order = 1)]
[Required]
[UIHint(UIHint.MediaFolder)]
public virtual ContentReference MyFolder { get; set; }
This will let you select a folder (only a folder) from the Edit interface, which you then can use for your file upload:
var repository = ServiceLocator.Current.GetInstance<IContentRepository>();
var file = contentRepository.GetDefault<GenericFile>(MyFolder);
...create blob, write and save file etc...
Hello!
I need to set a property on a page to allow the editor to select which asset folder uploaded images should be saved in. Right now, when a user submits an image in an form, I create a blob and just save it under SiteDefenition.Current.GlobalAssetRoot. How do I do this/change the place where I save the uploaded images?