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

storage: bucket.upload #167

Closed
ryanseys opened this issue Sep 2, 2014 · 3 comments
Closed

storage: bucket.upload #167

ryanseys opened this issue Sep 2, 2014 · 3 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

@ryanseys
Copy link
Contributor

ryanseys commented Sep 2, 2014

We can make a simple wrapper method for quick and easy file uploading:

var gcloud = require('gcloud');
var storage = gcloud.storage;

var bucket = new storage.Bucket({
  bucketName: YOUR_BUCKET_NAME,
  keyFilename: '/path/to/the/key.json'
});

bucket.upload('local_filename.jpg', 'remotename.jpg', function(err) {
  console.log(err || 'File uploaded successfully!');
});
@stephenplusplus
Copy link
Contributor

What about:

// Will upload with same filename.
bucket.upload('local_filename.jpg', function(err) {});

or and also allowing a config object:

bucket.upload('local_filename.jpg', {
  name: 'remotename.jpg'
  // other metadata
}, function(err) {});

@ryanseys
Copy link
Contributor Author

ryanseys commented Sep 4, 2014

Sure, yes. Both together would be a complete solution.

@stephenplusplus
Copy link
Contributor

This is part of the Storage API overhaul: #194

@jgeewax jgeewax added the api: storage Issues related to the Cloud Storage API. label Feb 2, 2015
@jgeewax jgeewax added this to the Storage Stable milestone Feb 2, 2015
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
chingor13 pushed a commit that referenced this issue Aug 22, 2022
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/5b03461e-47c0-40e8-a8ad-c465ee146cc5/targets

- [ ] To automatically regenerate this PR, check this box.
sofisl pushed a commit that referenced this issue Nov 11, 2022
* test: use fully qualified request type name in tests

PiperOrigin-RevId: 475685359

Source-Link: googleapis/googleapis@7a12973

Source-Link: googleapis/googleapis-gen@370c729
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzcwYzcyOWUyYmEwNjJhMTY3NDQ5YzI3ODgyYmE1ZjM3OWM1YzM0ZCJ9

* 🦉 Updates from OwlBot post-processor

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>
sofisl pushed a commit that referenced this issue Nov 11, 2022
fix: use google-gax v3.3.0
Source-Link: googleapis/synthtool@c73d112
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:b15a6f06cc06dcffa11e1bebdf1a74b6775a134aac24a0f86f51ddf728eb373e
sofisl pushed a commit that referenced this issue Nov 11, 2022
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 392067151

Source-Link: googleapis/googleapis@06345f7

Source-Link: googleapis/googleapis-gen@95882b3
sofisl pushed a commit that referenced this issue Nov 11, 2022
* chore(main): release 1.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 11, 2022
samples: pull in latest typeless bot, clean up some comments

Source-Link: https://togithub.com/googleapis/synthtool/commit/0a68e568b6911b60bb6fd452eba4848b176031d8
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:5b05f26103855c3a15433141389c478d1d3fe088fb5d4e3217c4793f6b3f245e
sofisl pushed a commit that referenced this issue Nov 16, 2022
Update npm scripts: add clean, prelint, prefix; make sure that lint and fix are set properly. Use post-process feature of synthtool.
sofisl pushed a commit that referenced this issue Nov 16, 2022
- [ ] Regenerate this pull request now.

feat: users cannot switch to empty default branch unless force override (v2alpha)
feat: allow search users to skip validation for invalid boost specs (v2alpha)
feat: support search personalization (v2alpha)
feat: search returns applied control ids in the response (v2alpha)
docs: users can self enroll retail search feature on cloud console (v2alpha)
docs: suggest search users not to send IP and use hashed user id (v2alpha)
docs: deprecate request_id in ImportProductsRequest (v2alpha)
docs: deprecate search dynamic_facet_spec and suggest to config on cloud console (v2alpha)
docs: keep the API doc up-to-date with recent changes (v2alpha)

PiperOrigin-RevId: 440123036

Source-Link: googleapis/googleapis@bc99550

Source-Link: googleapis/googleapis-gen@a0e1d65
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTBlMWQ2NTE1MTI4NzIyYzhjMTYyMTM4N2VhYjM3ODE4NjEyMjc5OCJ9
sofisl pushed a commit that referenced this issue Nov 30, 2022
🤖 I have created a release \*beep\* \*boop\* 
---
## [2.1.0](https://www.github.com/googleapis/nodejs-datacatalog/compare/v2.0.0...v2.1.0) (2020-06-16)


### Features

* add order field to TagField and TagTemplateField ([#157](https://www.github.com/googleapis/nodejs-datacatalog/issues/157)) ([70c23c2](https://www.github.com/googleapis/nodejs-datacatalog/commit/70c23c2b609bd24901dc902090e23fbf92b55895))
* move ts target to es2018 from es2016 ([#172](https://www.github.com/googleapis/nodejs-datacatalog/issues/172)) ([e354dde](https://www.github.com/googleapis/nodejs-datacatalog/commit/e354ddeeeedd3e106c50ed579075f23c9d9c5bb5))
* promote library to GA ([#177](https://www.github.com/googleapis/nodejs-datacatalog/issues/177)) ([ac11090](https://www.github.com/googleapis/nodejs-datacatalog/commit/ac110906b723f362024318295e3de6743c905b7e))


### Bug Fixes

* proper fallback option handling ([51df672](https://www.github.com/googleapis/nodejs-datacatalog/commit/51df6721306ab6d2d9bf6919b0f3f432ca85b4ab))
* regenerate unit tests ([#163](https://www.github.com/googleapis/nodejs-datacatalog/issues/163)) ([4593117](https://www.github.com/googleapis/nodejs-datacatalog/commit/45931176d266d364e0508039cf6a4e284ad2923d))
* synth.py clean up for multiple version ([#167](https://www.github.com/googleapis/nodejs-datacatalog/issues/167)) ([c799604](https://www.github.com/googleapis/nodejs-datacatalog/commit/c799604b2d29269006ff39748afb78302ce46ca2))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
sofisl pushed a commit that referenced this issue Jan 17, 2023
sofisl pushed a commit that referenced this issue Jan 26, 2023
* feat!: Removes AcceleratorType.TPU_V2 and TPU_V3 constants feat: Adds AcceleratorType.NVIDIA_TESLA_A100 constant feat: Adds BigQuery output table field to batch prediction job output config feat: Adds JobState.JOB_STATE_EXPIRED constant feat: Adds AutoscalingMetricSpec message feat: Adds PipelineService methods: CreatePipelineJob, GetPipelineJob, ListPipelineJobs, DeletePipelineJobs, CancelPipelineJobs feat: Adds fields to Study message

PiperOrigin-RevId: 384714314

Source-Link: googleapis/googleapis@cc51e48

Source-Link: googleapis/googleapis-gen@f87b91c

* 🦉 Updates from OwlBot

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

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this issue Jan 26, 2023
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

4 participants