i am using DXA 2.2 application with .net and sites 9.1 i have used Download schema to create multimedia components [zip] and attached them in parent component.
then parent component has been added to the page and page has been published.
when try to browse the page, zip file url is formed like below: us-en/Images/autopublish-deployer-extension-assembly_tcm6-1000.zip
but onclick of link its shows 404 error.
i have checked following:
Binary data folder: it does not have any images folder. not sure why folder is not get created.
publication properties for image url: /us-en/Images/
in dxa application model code :
[SemanticProperty("c:imagePackageStandard")]
public MultimediaSchema ImagePackageStandard { get; set; }
MultimediaSchema.cs is as follows
[SemanticEntity(CoreVocabulary, "DefaultMultimediaSchema")]
[Serializable]
public class MultimediaSchema : MediaItem
{
public override string ToHtml(string widthFactor, double aspect = 0, string cssClass = null, int containerSize = 0)
{
return string.Format("{1}", Url);
}
/// <summary>
/// Gets the default View.
/// </summary>
/// <param name="localization">The context Localization</param>
/// <remarks>
/// This makes it possible possible to render "embedded" Image Models using the Html.DxaEntity method.
/// </remarks>
public override MvcData GetDefaultView(Localization localization)
{
return new MvcData("Core:Download");
}
}
Broker has binary data that means publishing has no issue.
Any help or suggestion will be helpful.
MultimediaSchema.ToHtml
implementation looks quite peculiar/wrong. It is supposed to return HTML, not just a URL (and your don't needstring.Format
to return just a URL :-) But that's not the cause of this issue, though.