You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
Baki A.
9 years agoNew member | Level 1
Dropbox Java Api Upload "Public Folder"
How do I upload a file public and get link ? I am using Dropbox Java core api. Here.
public static void Yukle(File file) throws DbxException, IOException {
FileInputStream fileInputStream = new FileInputStream(file);
InputStream inputStream = fileInputStream;
try (InputStream in = new FileInputStream(file)) {
UploadBuilder metadata = clientV2.files().uploadBuilder("/"+file.getName());
metadata.withMode(WriteMode.OVERWRITE);
metadata.withClientModified(new Date(file.lastModified()));
metadata.withAutorename(false);
metadata.uploadAndFinish(in);
SharedLinkSettings linkSettings = SharedLinkSettings.newBuilder().withRequestedVisibility(RequestedVisibility.PUBLIC).build();
SharedLinkMetadata sharedLinkMetadata = clientV2.sharing().createSharedLinkWithSettings("/"+file.getName(), linkSettings);
System.out.println(sharedLinkMetadata.getUrl());
}
}
- Greg-DBDropbox Staff
[Cross-linking for reference: https://stackoverflow.com/questions/39344740/dropbox-java-api-upload-file ]
It looks like you've already found the methods for uploading and creating shared links. Is your code not working? If not, what error are you getting?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,884 PostsLatest Activity: 13 days agoIf 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!