Hello Folks. I’m looking for decent documentation on setting up this Drop Box Saver. I followed along as best I could but I just can’t seem to get it working. Does anyone know of any better documentation available out there?
You can see the error I get by clicking the Save to Dropbox button here → https://www.mytutorialcenter.com/centers-upload/web_ky_irvingweb
Where is the code you have generated so far?
I don’t see any.
However…
- Add a HTML-Component onto your page.
- Add the following code to your HTML-Comp.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dropbox Saver Demo</title>
</head>
<body>
<h1>Dropbox Saver Demo</h1>
<!-- Container for the Saver button -->
<div id="container"></div>
<script src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="YOUR_APP_KEY"></script>
<script>
// Function to create and append a Saver button
function createSaverButton() {
var options = {
files: [
{'url': 'https://dl.dropboxusercontent.com/s/deroi5nwm6u7gdf/advice.png', 'filename': 'advice.png'},
// You can specify more files here if needed
],
success: function () {
alert("Success! Files saved to your Dropbox.");
},
progress: function (progress) {
// You can handle progress updates here if needed
},
cancel: function () {
// Handle cancelation here if needed
},
error: function (errorMessage) {
alert("Error: " + errorMessage);
}
};
var button = Dropbox.createSaveButton(options);
document.getElementById("container").appendChild(button);
}
// Call the function to create the Saver button
createSaverButton();
</script>
</body>
</html>
- Save the settings of HTML-Comp.
- Publish website.
- Test the component.
It will show you —> ERROR <— because you forgot to implement your own API-KEY.
-
IMPLEMENT YOUR OWN API-KEY for DROPBOX.
-
Now it should already work.
-
Now you will need to generate some additional code → to connect your Wix-Site with the HTML-Comp. to be able to communicate.