Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set svg Content-Type #129

Closed
samdaltonmaag opened this issue Aug 22, 2014 · 11 comments
Closed

Unable to set svg Content-Type #129

samdaltonmaag opened this issue Aug 22, 2014 · 11 comments
Assignees
Labels
api: storage Issues related to the Cloud Storage API. 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@samdaltonmaag
Copy link

Hi,

SVGs that I upload to my bucket are being served as text/plain. I suspect that the mime type detection has failed, so I'm trying to set it manually. Here's an example metadata object I use during upload:

      metadata: {
        'Content-Type': 'image/svg+xml'
      }

There doesn't seem to be any documentation on how to set the content type, so any help is appreciated.

Cheers

@stephenplusplus
Copy link
Contributor

Just to confirm we're looking at the same thing, what version of gcloud-node are you running?

@silvolu
Copy link
Contributor

silvolu commented Aug 22, 2014

@samdaltonmaag there is an example in the storage regression test, the key should be contentType. You can find a complete description of Cloud Storage objects here.

@stephenplusplus
Copy link
Contributor

Small thing: it's actually contentType, not ContentType.

The bucket write functionality has changed since 0.3.0, so keep that in mind when looking at the repo's tests & docs.

@silvolu Can we put out a 0.4.0 before the weekend?

@samdaltonmaag
Copy link
Author

Ah yes, it's working with that property name. I'm using 0.3.0.
Appreciate the help.

@silvolu
Copy link
Contributor

silvolu commented Aug 22, 2014

@stephenplusplus yeah, but the way you write metadata hasn't changed ;-)

@silvolu silvolu closed this as completed Aug 22, 2014
@jgeewax jgeewax added api: datastore Issues related to the Datastore API. api: storage Issues related to the Cloud Storage API. and removed api: datastore Issues related to the Datastore API. labels Feb 2, 2015
@jgeewax jgeewax added this to the Storage Stable milestone Feb 2, 2015
@adamreisnz
Copy link

Could this be documented a bit clearer please? I reached this issue because I also couldn't find in the docs how to properly write the Content-Type meta data property, and tried to write it as:

let stream = gcsFile.createWriteStream({
      metaData: {
        'Content-Type': file.mimetype
      }
    });

Would be nice if this was documented, or a link to relevant documentation provided, somewhere here:

https://googlecloudplatform.github.io/gcloud-node/#/docs/v0.35.0/storage/file?method=createWriteStream

@stephenplusplus
Copy link
Contributor

We do show setting metadata in an example. Doesn't say much that you didn't see it, though! Could you contribute a PR with what you would have found helpful?

@adamreisnz
Copy link

If you can send me the link to the page where the meta data is shown in an example, then yes I could add a link to that page in the documentation.

@stephenplusplus
Copy link
Contributor

It's in the example for createWriteStream under "Uploading a File with Metadata"

@adamreisnz
Copy link

Ah, there it is. Yes, a link in the table at the metadata property to that example would be great. I'd create a PR for this, but not sure what repository/files I should be looking at.

@stephenplusplus
Copy link
Contributor

Thanks! The docs are inline with the code in this repo. Here's where the docblock starts for createWriteStream: https://github.com/GoogleCloudPlatform/gcloud-node/blob/v0.35.0/lib/storage/file.js#L702

stephenplusplus pushed a commit that referenced this issue Jun 9, 2016
See #129.
Make it clearer that the examples below contain information on how to set file meta data.
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 7, 2020
sofisl pushed a commit that referenced this issue Oct 13, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/53e2a61c-af19-4be7-b9af-c352b89a29fb/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@901ddd4
Source-Link: googleapis/synthtool@f96d3b4
sofisl added a commit that referenced this issue Nov 11, 2022
* build!: Update library to use Node 12
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this issue Nov 11, 2022
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this issue Nov 11, 2022
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [jsdoc-region-tag](https://github.com/googleapis/jsdoc-region-tag) | [`^1.0.6` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-region-tag/1.3.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/compatibility-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/confidence-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/jsdoc-region-tag</summary>

### [`v2.0.0`](https://github.com/googleapis/jsdoc-region-tag/blob/HEAD/CHANGELOG.md#&#8203;200-httpsgithubcomgoogleapisjsdoc-region-tagcomparev131v200-2022-05-20)

[Compare Source](https://github.com/googleapis/jsdoc-region-tag/compare/v1.3.1...v2.0.0)

##### ⚠ BREAKING CHANGES

-   update library to use Node 12 ([#&#8203;107](https://github.com/googleapis/jsdoc-region-tag/issues/107))

##### Build System

-   update library to use Node 12 ([#&#8203;107](https://github.com/googleapis/jsdoc-region-tag/issues/107)) ([5b51796](https://github.com/googleapis/jsdoc-region-tag/commit/5b51796771984cf8b978990025f14faa03c19923))

##### [1.3.1](https://www.github.com/googleapis/jsdoc-region-tag/compare/v1.3.0...v1.3.1) (2021-08-11)

##### Bug Fixes

-   **build:** migrate to using main branch ([#&#8203;79](https://www.github.com/googleapis/jsdoc-region-tag/issues/79)) ([5050615](https://www.github.com/googleapis/jsdoc-region-tag/commit/50506150b7758592df5e389c6a5c3d82b3b20881))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-access-approval).
sofisl pushed a commit that referenced this issue Nov 11, 2022
* chore(main): release 2.1.2

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this issue Nov 16, 2022
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped) | [`^8.0.4` -> `^9.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/8.2.3/9.1.1) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/compatibility-slim/8.2.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/confidence-slim/8.2.3)](https://docs.renovatebot.com/merge-confidence/) |

---

### Configuration

📅 **Schedule**: "after 9am and before 3pm" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-network-connectivity).
sofisl pushed a commit that referenced this issue Nov 16, 2022
sofisl pushed a commit that referenced this issue Nov 16, 2022
* chore(deps): upgrade gapic-generator-java to 2.4.1

PiperOrigin-RevId: 422607515

Source-Link: googleapis/googleapis@ba2ffd6

Source-Link: googleapis/googleapis-gen@73ba4ad
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzNiYTRhZGQyMzlhNjE5ZGE1NjdmZmJkNGU1NzMwZmRkNmRlMDRkMyJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

6 participants