3

I have a field on a template using the "Attachment" type. There's only 1 attachment field on the template and it's named "Blob" (I read that these were requirements of that field type). The upload worked great in 8.1. We recently upgraded to 8.2. Now when I click "Attach" it lets me select a file and it appears to upload but then I get a prompt to "Save" the file. It renames the file to the name of the Sitcore item but it is the file I just uploaded and nothing has been uploaded to the field.

This has been attempted in Chrome, Edge, FF and IE11 in multiple environments with the same result.

3

It looks like in Sitecore 8.2, you now need an "Extension" field for Sitecore to understand the attachment type properly.

Add a single-line text field called "Extension" to your template, alongside the blob field. Make sure it has the same specs as the blob field (unversioned or shared).

Once this field is in place, Sitecore will properly fill it out for files you attach. As a bonus, Sitecore will now render the file preview properly for known types.

To fix existing attachments, I can see three possible solutions:

  • Put together a script to fill out the Extension field. Presumably you are saving the file name in addition to the blob, so this should be possible.
  • If you know what extension to expect, you could set it using standard values.
  • Re-attach existing attachments.

For the new Publishing Service to publish your blob fields, see this answer: https://sitecore.stackexchange.com/a/999/890

  • That worked! Thank you. However it's not publishing with the new Publishing Service 2.0.0. The attachment is a ".js" file. The extension field publishes but the Attachment field is not publishing. Any ideas? – BFK Apr 20 '17 at 17:55
  • See this answer: sitecore.stackexchange.com/a/999/890 – maz Apr 20 '17 at 19:12
  • I saw that post. I'm not able to change (or create a new field) with the template field "Blob". I see the "Blob" item in Sitecore but when I go to select it, I don't see anything below "File". Is there another way to reference the "Blob" item? – BFK Apr 21 '17 at 10:21
  • 1
    nevermine. I went with option 2 and just added the item id of my field to the publishing service config. That worked. – BFK Apr 21 '17 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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