Collapse
Submit a Service Request
Contact Information for Technical Support
My Service Notifications
Attachment links in Knowledge Advanced articles
Answer ID 12915 |
Last Review Date 10/17/2024
Why are links to article attachments going to the wrong file?
Environment:
- Oracle B2C Service sites with Knowledge Advanced only, any version
- Customer Portal
Issue:
Some article 1234567 has several attachments. From Customer Portal, we copy a link to /ci/okcsFattach/get/1234567_3 for a certain attachment. Another user doesn't get the right file when they click on that link.
Resolution:
- Authors should link to the article when linking to the attachment in another article or externally.
- Users should retrieve the attachment directly from the answer_view page.
For certain content types it may be useful to place the attachments higher in the schema so that when the answer is linked to reference an attachment, the user can quickly find the link.
Cause:
Links to the attachments from an article are not necessarily expected to be static.
Customer Portal retrieves all content on behalf of the current user according to their permissions. The links to the attachments are generated by enumerating the attachments that are in the retrieved content.
Say there is an article with attachments like this.
- AAA.gif - "internal" user group
- YYY.txt - no user group
- ZZZ.png - no user group
Alice wants to send Bob a link to YYY.txt. She opens answer 1000000 in Customer Portal and copies the link to the attachment.
Scenario 1: Alice has the internal user group. The link she sends to Bob ends is to <example-site>/ci/okcsFattach/get/1000000_2.
- If Bob has the internal user group, he gets YYY.txt as Alice intended.
- If Bob does not have the internal user group, he might get ZZZ.png because it is now the second attachment (for him)
Scenario 2: Alice does not have the internal user group. The link she copies ends with 1000000_1.
- If Bob has the internal user group, he gets AAA.gif
- If Bob does not have the internal user group, he gets YYY.txt as Alice intended.
Notes:
Consider your attachment schema carefully if you plan to link to attachments from other places. It is possible to put a node for public attachments higher in the schema than for private attachments to prevent this behavior when only the public attachments are being linked to.
An implementer could consider extending the answer view-related widgets and okcsFattach controller to use the attachment filename as its passed parameter instead of the n-th attachment in the document.