tus-node-server icon indicating copy to clipboard operation
tus-node-server copied to clipboard

GSC Datastore does not support "contentType" property

Open joshbeal opened this issue 9 years ago • 4 comments

There should be a way to set contentType on the uploaded object as such...

var stream = file.createWriteStream({ metadata: { contentType: } });

joshbeal avatar Nov 09 '16 01:11 joshbeal

Hey @joshbeal, what is passed through in the Upload Metadata header (as per the protocol) is set on the GCS Object.

Will that suffice for your usage? If not, feel free to send over a PR with some code to discuss. Thanks for using tus!

bhstahl avatar Nov 17 '16 12:11 bhstahl

I'm noticing that when completing an upload using a GCS datastore, that there is no metadata passed to the completion event at all. metadata: {} is all I see. any idea if this is related?

edwar64896 avatar Nov 25 '16 01:11 edwar64896

As of now, upload_metadata is just injected as a key of the metadata So it offers no way to update the contentType, which is another key, as you can tell by the screenshot

screenshot at aug 18 15-21-51

we'd need something like, and then there's maybe a way to update the contentType

metadata: {
...metadata_upload
}

The only work around right now is to call setMetadata method on the google cloud storage api, when upload is done.

tkrugg avatar Aug 18 '18 13:08 tkrugg

@tkrugg Would you mind opening a PR for this?

Acconut avatar Aug 20 '18 06:08 Acconut