Copy file from external AWS S3 bucket

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 11:09 AM
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.
- Labels:
-
Alfresco Content Services

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 04:24 AM
- Nodes::createNode: This would create the node metadata as you mentioned.
- Direct S3 Copy: You can copy the file from your external S3 bucket directly to Alfresco's S3 bucket using AWS's CopyObject request.
- 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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2023 06:16 AM
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.
