In a community (napili) there is a button (global action on case) that allow users to create a new case and add an attachment to this case.
When I do that, it creates me a case, and an attachment to this case. But in the developper console, if I try to access this attachment with a query like this in the query editor, it found nothing :
SELECT Id, ContentDocument.title, ContentDocument.ContentModifiedDate, ContentDocument.FileExtension, ContentDocument.ContentSize, ContentDocument.FileType, ContentDocument.LatestPublishedVersionId FROM ContentDocumentLink WHERE LinkedEntityId ='5009E000007fay3QAA'
Also, if I add an attachment to a created case, via a lightning component with the tag
lightning:fileUpload, when I try the query it works and retrieve the attachment.
Moreover, when I click the attachment in the attachment's list of a case, when it is the case added with the community it did not display the file, it only download it. Conversely when I click the attachment create by the lightning component, it display it like this :
I need to get the attachments list of a case when the case is created, but as I said the query retrieve nothing when the attachment is added at the creation of the case.