Digital files management
With Sharetribe’s digital files management features, listing authors can upload and download digital files and attach them to other resources. There are three key concepts related to digital files management:
fileis the Sharetribe representation of the uploaded digital file item.ownFileis the Sharetribe representation of the uploaded digital file item visible to the author of the upload.fileAttachmentis the association of afileto another marketplace resource, such as a message.
The actual digital file entity is uploaded to and downloaded from Sharetribe storage with a direct URL, not through the Sharetribe APIs. The URLs are managed through three other resource types:
fileUploadcontains the URL and other details for uploading a file directly to storage.fileDownloadcontains the URL for downloading a file directly from storage.ownFileDownloadcontains the URL for downloading a user’s own uploaded file directly from storage.
File states
A file can be in one of several possible states:
pendingUploadpendingVerificationavailableverificationFailed
Files change state as a result of the file verification process that
happens once a user uploads the digital file entity using the signed
upload URL. Download URLs are only generated for files in available
state.
File attachment scopes
A file resource can be associated with another resource by adding it
to the other resource’s file attachments. The scope of the file
attachment determines the visibility of the file:
publicFileAttachmentsare visible to all users who have access to the resource in questionprotectedFileAttachmentsare visible to the user who created the resource, and additionally the file can be revealed in a transaction to the other transaction participantprivateFileAttachmentsare visible only to the user who created the resource.
The API reference details which resources have which scopes of file attachments available.