Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot upload a image file in the EPiServersite

I have created a EPIServer CMS site using visual studio. I am able to access the site using edit mode. I want to add some image on that site. But when I am trying to upload a image using the upload option it is showing failed message.Why it is happening do you have any idea. But when I have uploaded the images from the demp 'Aloy Site' given by EPIServer team it is uploaded successfully. Please tell the probable cause of this.

Thanks and regards Utpal Maity

like image 282
Utpal Avatar asked Jan 12 '23 10:01

Utpal


1 Answers

I also got the fail to upload images. Firstly I thought it was a config-setting or a permission problem. But it turned out that I needed a "media descriptor".

You can read about it here. This applies for EPiServer CMS 7.x

C# example:

[ContentType]
[MediaDescriptor(ExtensionString = "jpg,jpeg,jpe,gif,bmp,png")]
public class ImageFile : ImageData
{
    public virtual string AlternativeText { get; set; }
}
like image 77
random user 42 Avatar answered Feb 24 '23 17:02

random user 42