Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Natasha A.
10 years agoNew member | Level 1
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?
12 Replies
Replies have been turned off for this discussion
- Greg-DB10 years ago
Dropbox Community Moderator
[Cross-linking for reference: https://stackoverflow.com/questions/34984386/dropbox-api-other-users-permission-to-upload-into-my-folder ]
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.10 years agoNew 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.10 years agoNew 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-DB10 years ago
Dropbox Community Moderator
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:
- Natasha A.10 years agoNew 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-DB10 years ago
Dropbox Community Moderator
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:
- Natasha A.10 years agoNew 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.FileName)",
new HttpParameterCollection
{
{ "access_token", token },
{ "overwrite", "true" },
{ "path", serverPath },
{ FileUpload1.PostedFile }
}
); - Greg-DB10 years ago
Dropbox Community Moderator
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.10 years agoNew 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?
- Greg-DB10 years ago
Dropbox Community Moderator
No, there currently isn't an API for file requests, but I'll be sure to pass this along as a feature request.
About 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!