Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Unified Diff: polymer_1.0.4/bower_components/cors-upload-sample/README.md

Issue 1205703007: Add polymer 1.0 to npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Renamed folder to 1.0.4 Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: polymer_1.0.4/bower_components/cors-upload-sample/README.md
diff --git a/polymer_1.0.4/bower_components/cors-upload-sample/README.md b/polymer_1.0.4/bower_components/cors-upload-sample/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..db14e646876918396d45b881062f57c27eef6616
--- /dev/null
+++ b/polymer_1.0.4/bower_components/cors-upload-sample/README.md
@@ -0,0 +1,24 @@
+# cors-upload-sample
+
+Sample code for uploading files directly with vanilla Javascript (XHR/CORS). Try the [live version](http://googledrive.github.io/cors-upload-sample)
+and drag & drop files to upload them to Google Drive.
+
+This sample has only been tested with Chrome. Other browsers may or may not work.
+
+## Usage
+
+If you'd like to use the code in your own project, copy `upload.js` and include it.
+
+ <script src="/path/to/upload.js"></script>
+
+When uploading a file, create a new MediaUploader initialized with a Blob or File and access token. Then call `upload()` to start the upload process.
+
+ var uploader = new MediaUploader({
+ file: content,
+ token: accessToken,
+ });
+ uploader.upload();
+
+Your access token need to be authorized for any of the Drive scopes that permit writes (drive, drive.file, or drive.appdata.) You can go through [one of the OAuth 2.0 flows](https://developers.google.com/accounts/docs/OAuth2) to retrieve one or use [Google+ Sign-In](https://developers.google.com/+/web/signin/) button.
+
+See `upload.js` for additional parameters you can include when initializing the uploader, including callbacks for success & failure events.

Powered by Google App Engine
This is Rietveld 408576698