Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hi,
I can upload my files with:
public void uploadFileToDropbox(File inputFile, String path, String fileName) throws Exception{ InputStream inputStream = new FileInputStream(inputFile); try { FileMetadata uploadedFile = client.files().uploadBuilder("/"+path+"/"+fileName).uploadAndFinish(inputStream); System.out.println("Uploaded to Dropbox: " + uploadedFile.getName()); } finally { inputStream.close(); } }
How can I get the URL of the folder? I tried this:
public String getShareLink(String path) throws DbxException{ SharedLinkMetadata slm = client.sharing().createSharedLinkWithSettings(path); return(slm.getUrl()); }
But I always get:
java.lang.IllegalArgumentException: String 'path' does not match pattern
Changed the URL Line like that:
SharedLinkMetadata slm = client.sharing().createSharedLinkWithSettings("/"+path);
Changed the URL Line like that:
SharedLinkMetadata slm = client.sharing().createSharedLinkWithSettings("/"+path);
Hi there!
If you need more help you can view your support options (expected response time for a 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!