Allow setting metadata when copying
See original GitHub issueWe store some metadata on images regarding which post a certain image belongs to. We have some cloud functions that listen to new files being added and depending on the metadata we do some actions.
We now want to be able to copy a file to a new location. But because our triggers fire of as soon as we use the copy command we would like to be able to specify what should happen with the metadata.
https://googleapis.dev/nodejs/storage/latest/File.html#copy https://googleapis.dev/nodejs/storage/latest/global.html#CopyOptions
Either we should be able to say, skip copying the metadata.
const file = bucket.file('my-image.png');
file.copy('my-image-copy.png', {
metadata: null
}
Or we should be able to set the metadata from the copy method.
const file = bucket.file('my-image.png');
file.copy('my-image-copy.png', {
metadata: {
thisIsACopy: true
}
}
What we have tried
- downloading the file and uploading again. (takes to long, and means extra costs)
- removing the metadata on the source before copying (not ideal because then we need to put the metadata back again)
Would this be possible?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
How to Collect, Copy and Move Data Without Changing its ...
The best way to ensure you're not changing the metadata of the data you collect is to "containerize" it. This is done by...
Read more >Preserve metadata and ACLs using copy activity - Azure Data ...
Learn how to preserve metadata and ACLs when using the copy activity in Azure Data Factory and Synapse Analytics pipelines.
Read more >AzCopy - how to specify metadata when copying a file to a ...
I'm trying to upload a file to an Azure Blob storage using AzCopy, but I want to include metadata ...
Read more >Metadata copied by AWS DataSync
Learn how AWS DataSync copies data between storage systems with similar and different metadata structures.
Read more >Ensure Custom Settings copy across from live -> sandbox
The premise of a sandbox copy is that 'meta data' gets copied across (details of objects, fields, etc) but actual application data does...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Good question for @tritone who is on duty right now
Thanks for this! Now we can null out the metadata, which is a start 😃