Take Your Search Game to the Next Level with Dropbox Dash  🚀✨ Curious how it works? Ask us here! 

Forum Discussion

Stefano B.3's avatar
Stefano B.3
New member | Level 1
9 years ago

Access token js , security ?

HI sorry for english :

i use this script to upload file directly  on my dropbox app with javascript:

<form onSubmit="return uploadFile()">
<input type="hidden" id="access-token" value="<?=$token ?>" />
<label>Seleziona il file da caricare</label>
<br>
<input type="file" id="file-upload" />
<br>

<button type="submit">Esegui l'upload</button>
</form>

in this way the access token is show in souce code .

if a developer use this access token can create an app and manage the file of my folder ,
it's true ?
if it's true how can i secure it ?

1 Reply

  • If you're trying to build an app for clients to upload files to one Dropbox account (say your personal account), then there is no client-side solution that will allow clients to securely upload directly to your Dropbox. Your access token will always be exposed client-side.

    If you want to use your personal Dropbox account as a place for users to upload content, then you will need to implement a server-side solution. For example, you can have clients upload content to your server and then from your server, you can upload the content directly to your personal Dropbox account. In this case, you would not want to use the JavaScript SDK, instead perhaps the Java SDK (https://www.dropbox.com/developers/documentation/java).

    Does this answer your question? 

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,988 PostsLatest Activity: 13 hours ago
378 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!