0

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.

enter image description here

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:

  1. Binary data folder: it does not have any images folder. not sure why folder is not get created.

  2. publication properties for image url: /us-en/Images/

  3. 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.

1
  • Your MultimediaSchema.ToHtml implementation looks quite peculiar/wrong. It is supposed to return HTML, not just a URL (and your don't need string.Format to return just a URL :-) But that's not the cause of this issue, though. Commented Mar 29, 2022 at 14:56

1 Answer 1

3

It turned out the problem was that the DxaStaticContentModule was disabled in web.config. This DXA HTTP Module is essential for handling requests for Static Content Items (incl. Media Items).

1
  • thank you Rick Pannekoek Commented Mar 30, 2022 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.