cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need a custom web-page where students upload files into a teacher's Dropbox. I use Dropbox for Business and created a web-page with upload files from my web-page to my dropbox folder with API/C#/OAuth2, what about other people uploading into my folder?

Need a custom web-page where students upload files into a teacher's Dropbox. I use Dropbox for Business and created a web-page with upload files from my web-page to my dropbox folder with API/C#/OAuth2, what about other people uploading into my folder?

Natasha A.
New member | Level 1
 
12 Replies 12

Greg-DB
Dropbox Staff

[Cross-linking for reference: https://stackoverflow.com/questions/34984386/dropbox-api-other-users-permission-to-upload-into-my-fo... ]

HI Natasha, I'm not sure I fully understand your question. If you already have an implementation where you can upload files via the API, and want other people to be able to do so as well, it sounds like you just need to let them access that page as well. Can you clarify? Thanks!

Natasha A.
New member | Level 1

Hello Gregory,

I would like other users to be able to upload files from my custom web-page. The files they upload will be stored in my private Dropbox folder and the users will not have access to view the folder, just upload. Thank you!

 

Natasha A.
New member | Level 1

Here is what I have:

var result = OAuthUtility.Put
(
"https://api-content.dropbox.com/1/files_put/auto/",

new HttpParameterCollection
{
{ "access_token", token },
{ "overwrite", "true" },
{ "path", serverPath },
{ FileUpload1.PostedFile }
}
);

Here is what I am looking to do.
var result = OAuthUtility.Put
(
" What link do I have here in order for other users to place into my folder, example this one? ",
https://www.dropbox.com/sh/noxsnids7gtm5dl/AABQm62hVLh_iSW1fhfTgqFLa?dl=0
new HttpParameterCollection
{
{ "access_token", token },
{ "overwrite", "true" },
{ "path", serverPath },
{ FileUpload1.PostedFile }
}
);

Greg-DB
Dropbox Staff

Thanks for following up with the additional information. It looks like you're trying to use the API v1 /files_put endpoint. This does let you upload files into an account, so you're on the right track. It looks like you already have some code, but for reference the full documentation can be found here:

https://www.dropbox.com/developers-v1/core/docs#files_put

The destination path and parameters should be specified on the URL, and the file content should be supplied in the body. For example, if the folder is named "Everything is simple" and located in the root of your Dropbox, the path value would be: "/Everything is simple". 

Also, alternatively, Dropbox does have a feature called "file requests" that may address your need without you having to build anything custom. You can find information about it here:

https://www.dropbox.com/help/9090

Natasha A.
New member | Level 1

Hello Gregory,

I cannot use file requests because it's disabled. How/where it can be reactivated? I am the admin.

Also is this a correct way to use put files? I am very new to API. Thank you!

var result = OAuthUtility.Put
(

"https://content.dropboxapi.com/1/files_put/auto/CSUF_test121?dl=0",
new HttpParameterCollection
{
{ "access_token", token },
{ "overwrite", "true" },
{ "path", serverPath },
{ FileUpload1.PostedFile }
}
);

Greg-DB
Dropbox Staff

I'm not familiar with the third party library you're using, so I can't say offhand how you should specify the parameters. 

Also, apologies I wasn't clear in my previous reply. That path value was only the folder portion. The full path value should also include the desired file name, e.g., "/Everything is simple/test_upload.txt".

Anyway, as the admin of a team, you can enable/disable file requests here:

https://www.dropbox.com/team/admin/sharing

Natasha A.
New member | Level 1

Hello Greg

 

If you can be so kind to test this link  https://netcert.fullerton.edu/dropboxfiles/  to let me know what I need to fix.

For now, it's just creates a folder in another user Dropbox and upload the file. Nothing gets into my folder.

string serverPath = System.IO.Path.GetFileName(FileUpload1.FileName);

var result = OAuthUtility.Put
(

"https://content.dropboxapi.com/1/files_put/auto/CSUF_test121/System.IO.Path.GetFileName(FileUpload1....",
new HttpParameterCollection
{
{ "access_token", token },
{ "overwrite", "true" },
{ "path", serverPath },
{ FileUpload1.PostedFile }
}
);

Greg-DB
Dropbox Staff

The API was designed with the intention that each user would link their own Dropbox account, in order to interact with their own files. However, it is technically possible to connect to just one account. The SDKs don't offer explicit support for it and we don't recommend doing so, for various technical and security reasons. Most of these concerns are allayed for server-side apps though.

However if you did want to go this route, instead of kicking off the authorization flow (i.e., sending the user to /authorize), you would manually use an existing access token for your account and app. (Just be careful not to revoke it, e.g. via https://www.dropbox.com/account/security .)

In your case, this means you would always set the token variable to a hard coded access token for your account in particular.

Natasha A.
New member | Level 1

Thanks a lot! It make sense, and it works now!

I'll look into the feature "file requests". Do you have API for it? 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Zvonimir D. New member | Level 2
  • User avatar
    Natasha A. New member | Level 1
What do Dropbox user levels mean?