Forum Discussion

Esikhoob's avatar
Esikhoob
Helpful | Level 5
3 years ago

can our website`s users upload without create an account

Hi

In our ASP.NET website ,we want to give to our users, the ability to upload to Dropbox, instead of our website (because of lack of space).

I read API`s documentation and example of JavaScript`s SDK and found out all user should have to sign in to their own Dropbox`s account ,No matter the file is uploading to our Dropbox account.

Is there any other way except this way? I mean without sign in to their account, which we do not use?

4 Replies

  • Здравко's avatar
    Здравко
    Legendary | Level 20
    3 years ago

    Hi Esikhoob,

    You can handle your problem in 2 ways generally. You can forward (re-upload) the files your users upload to your website to Dropbox using any of the available upload methods (depending on the files count/size) without storing them to your server at all. Such a way is more predictable since you're doing everything and all is on your control - your server would serve as something like a proxy. Another way is to generate temporary upload link(s) and upload directly from end users browser to Dropbox server. Such a way is more simple to implement, but difficult for trace and debug if any issue appears (you should implement some way for logging what happens on users browser to be aware of issues nature).

    Good luck.

  • Esikhoob's avatar
    Esikhoob
    Helpful | Level 5
    3 years ago

    Thankyou

     

    I think there is a third way. using your answer in https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-function-in-NET-SDK-is-for-oauth2-token/m-p/673861 , I can generate access token in .NET side (help of modified .NET`s SDK) and send them to Javascript side and use that to send file with help of Javascript`s SDK.

    I have a question on your second ways:

    Do you mean I can upload a file to a Dropbox`s shared link with help of Javascript`s SDK? I tried to upload a file to a Dropbox`s shared link using Postman software. As you can see in the attached picture, I get an error.

  • Здравко's avatar
    Здравко
    Legendary | Level 20
    3 years ago

    Esikhoob wrote:

    ...

    I think there is a third way. using your answer in https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-function-in-NET-SDK-is-for-oauth2-token/m-p/673861 , I can generate access token in .NET side (modified .NET`s SDK) and send them to Javascript side and use that to send file with help of Javascript`s SDK.

    ...


    Yes, it's always an option for everything, but in such a way you're exposing (despite of temporary) the access you granted to the end user (the passed access token can be caught). This way is only usable for "internal" use (i.e. in a set of users that you can rely on). Otherwise your system can be hacked very easy! 🤫

     


    Esikhoob wrote:

    ...

    Do you mean I can upload a file to a Dropbox`s shared link with help of Javascript`s SDK? I tried to upload a file to a Dropbox`s shared link using Postman software. As you can see in the attached picture, I get an error. 


    First of all, you're using preview link, not a shared one! Anyway, you cannot upload using any such link (preview or real shared link). As I said you need upload link - it's something different. Take a look here in the sources for details. 😉

    Hope this sheds some more light.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    3 years ago

    Esikhoob The API was designed with the intention that each user would link their own Dropbox account, in order to interact with their own files. As Здравко said, you can send files to just your own account, though you should not expose any access tokens or refresh tokens for your account to other users. And as they mentioned, you could instead do so by essentially proxying the file uploads through your own server, or by using temporary upload links. It is not possible to upload directly to a preview link or shared link.

     

    Alternatively, you may want to use "file requests". The API also offers the ability to manage file requests programmatically.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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, Facebook or Instagram.

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!