Copy file from external AWS S3 bucket

cancel
Showing results for 
Search instead for 
Did you mean: 
Doc_JM
Member II

Copy file from external AWS S3 bucket

Hello.

We use Alfresco 7 with AWS S3.
We use Nodes::createNode to create the node metadata and than use ContentWriter:: putContent to upload the file.

Is it possible to use Nodes::createNode only and copy the file from an external S3 bucket right into the Alfresco's S3 bucket?
If so, what S3 key should the file have? What additional properties we need to specify to bind the file to the metadata?

Thanks.

2 Replies
Rebeccamorley
Member II

Re: Copy file from external AWS S3 bucket

  1. Nodes::createNode: This would create the node metadata as you mentioned.
  2. Direct S3 Copy: You can copy the file from your external S3 bucket directly to Alfresco's S3 bucket using AWS's CopyObject request.
  3. S3 Key & Metadata Binding: The key within Alfresco's S3 bucket will usually follow Alfresco's content URL, which often looks like store://<UUID>.bin. To bind the file to the metadata, you'll need to ensure that the content URL matches what's used in Alfresco's database. Tell Tims
Doc_JM
Member II

Re: Copy file from external AWS S3 bucket

Thank you very much.

I have additional questions.
After creating metadata I have this value in the cm:content property contentUrl=s3v2://d95812c0-f8b5-4ec4-920e-1f36b1affc76.bin|mimetype=application/pdf|size=0|encoding=UTF-8|locale=en_US_|id=248.
So that means I need to put d95812c0-f8b5-4ec4-920e-1f36b1affc76.bin file in the bucket root.
But I have no idea how to get cm:content in code to find out the file name. And how to modify it to change size=0 to real size.