Comments (9)
Hi @nathancarter Thanks for the words of appreciation. Yes that is possible. Set retrieve_token
to true
in the configuration options for the File Explorer, so your front-end/back-end service can make API requests authorized with the Bearer token. Your application can then use file update API endpoint (docs) to upload the updated file contents. If you do not have the file content and instead want to upload via a URL, use the upload endpoint (docs) with the URL, but set overwrite
to true
so it updates the existing file.
Your domain must be white-listed on the App Details page to retrieve the token.
from file-picker.
Thank you for the quick reply! That's great to hear. Even though I don't understand it all yet (since I haven't started tinkering with Kloudless yet, so I haven't learned the ins and outs of the API) this gives me confidence that I should give it a try, and I can return here when I need to learn how to do this. Thanks again.
from file-picker.
After digging a bit...I note that the docs suggest doing this via curl
on the command line. My application is entirely client-side. Can this be done with AJAX and CORS or will api.kloudless.com reject an AJAX request of this type? Furthermore, is there a JavaScript API to accomplish this same task?
from file-picker.
@nathancarter HTTP requests via ajax would definitely work and won't be rejected due to CORS. You can reference our HTTP API documentation for how to perform the ajax request. We use curl to provide an example, but the HTTP request can be made from any client-side application.
from file-picker.
Nice!
from file-picker.
Just to close the loop on this, the reason I ended up not using Kloudless in the end is that I'm generating the content to save within the editor itself (obviously) rather than finding it somewhere as a URL on the Internet. And yet the Kloudless API doesn't support base-64-encoded data URIs, so I can't transmit the data directly to Kloudless from my client-side app. But thanks for all the help along the way!
from file-picker.
@nathancarter I am sorry to hear that you ended up not using Kloudless. I am somewhat confused by your requirement for base64-encoded data URIs for upload purposes. Typically our users perform uploads by sending the raw binary file contents in the request body or via multi-part encoded form. Could you clarify that requirement a bit more?
from file-picker.
I was essentially looking for a way to send data generated in the browser (e.g., the user typing a document into an editor in the page, then wanting to save that content) to Kloudless. Since I saw that Kloudless accepted URLs, the first thing that came to mind was to send a data URI containing the user's data. All the other examples I came across seemed to require some kind of server back-end in the app that wanted to access Kloudless, whereas my app is client-side only. Is there a different approach you'd recommend for client-side-only apps? Perhaps you have a pure JavaScript example of the binary upload you're describing?
from file-picker.
I am not able to write up a full example at the current time, but if you are able to load your data into a Javascript Blob
object, then that can be sent via an XMLHttpRequest using the send
method. You should be able to set the relevant headers prior to sending as well.
from file-picker.
Related Issues (20)
- CASHOUT
- React Chooser onDeleteAccount event does not return accountId as specified in the docs HOT 3
- How to see 'connected accounts' ? HOT 1
- Is persistent file access supported? HOT 1
- Can I save a file using a base-64-encoded data URL? HOT 3
- Chrome console showing an error 404 HOT 5
- bearer_token is never set, APIKey works HOT 1
- Breadcrumbs are not aligned when width is constrained in Safari HOT 1
- Explorer default to My Computer HOT 3
- Storj.io gateway integration HOT 3
- Cancel cancel causes upload HOT 2
- Not receiving bearer_token from file chooser HOT 2
- jquery.ui.plupload.js contains an unprintable character HOT 2
- console logging HOT 4
- TypeScript type definitions HOT 1
- Uncaught type error after adding files for upload HOT 3
- Using `multiselect: false` still shows multiple file selection dialog HOT 3
- Cancel button transmogrified following upload in Safari HOT 2
- Dropzone allows dropping wrong file types HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from file-picker.