I created records in a custom object. For each record I uploaded a file(which will store as a salesforce file) through a lightning component. If i click on record name, It will show the attached file preview of that record. I am able to show file preview temporarily using Lightning Openfiles event. But it will lost if I refresh the screen. Can anyone please suggest me the solution ?

  • Please can you provide your code? – Robs Jan 26 '19 at 19:18
  • I'm not sure I follow what the problem is for which you are seeking a solution. In addition to a code sample, as Robs asked, I would suggest you describe your problem in more detail and/or provide screen shots of the behavior you are trying to change. – David Reed Jan 26 '19 at 19:36

You can use a regular img tag.

<img src="mysite.force.com/mycommunity/sfc/servlet.shepherd/document/download" + {!v.documentId} />

Just be sure to query and store the documentId in an `aura:attribute' or as a field on the object you already queried.

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.