0
votes

I'm using Kentico v9

I have a content only Page Type with a Rich Text field. The user edits the text and using the toolbar, clicks the image icon to add an image. They choose a file. It uploads the image, but the link created causes a 404 error. I can see the image listed in the Properties/Attachments list, but trying to browse the image gives a 404. Interestingly, I can edit the photo and it will appear in the edit screen so I know the image upload was successful.

The link that is automatically embedded in the HTML is /getattachment/folderPage/imageName.jpg

I've seen some others with a similar issue, but none of those solutions seemed to work.

Any help will be appreciated. Eric

3

3 Answers

2
votes

Given that the image URL path you provided is /getattachment/folderPage/imageName.jpg, check if you have configured the module preconditions in the web.config file.

In the <system.webServer> element, check if you have the runAllManagedModulesForAllRequests property set to true for the modules element.

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true">

This is a requirement for extensionless URLs

1
votes

I usually don't follow this approach for precisely the problem you are facing.

There are two things you may check

  1. Configure extension-less URL like [this] (https://docs.kentico.com/display/K8/Custom+and+extensionless+URLs)

    <modules runAllManagedModulesForAllRequests="true">

  2. Prefer to to upload all attachments that you want to use first in media library and then use reference in your article. This way it is easily accessible across multiple places and easy to migrate using content staging.

1
votes

A) Did you properly set webfarms and both of your webfarms are healthy?

From docs:

Content synchronization, for example of smart search indexes, is handled by web farms.

B) Did you properly set hashsalt string in both web.config-s?

From docs:

Copy the value of the CMSHashStringSalt appSettings key from the web.config of the Kentico project and add the value into the same key in the MVC project's web.config (it is empty by default). This ensures that the MVC application generates hashes using the same salt value as the Kentico application (for example for macro signatures or page preview links).

C) Do you have two proper licences (one for administration and one for MVC site with enabled webfarms)?

From docs:

The Kentico development model for ASP.NET MVC application relies on the web farms functionality. To use web farms in your Kentico instance, you need to acquire another server license for each additional server in the web farm. Without an appropriate license key, certain Kentico services (for example Smart search) cannot work properly because the data is not synchronized.

D) Did you set properly presentation URL?

From docs.

If you want to run your live site on a different domain than where you run Kentico administration (for example, when running a separate MVC application), you need to specify a URL leading to the site's domain.

Could you additionally check event log for any errors or warnings?

EDIT: It`s not required to use runAllManagedModulesForAllRequests (iis 7.5+ I think) for extension less. You have to use it for proper handling of 404s.