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
Kid
8 years agoNew member | Level 2
Download a file or directory
Hey guys,
actually I am trying to program a Java application which can enter dropbox, look up which directories and files exist, upload a file and download a directory. Unfortunately I have some problems with the downloading part.
Every time I try to download only a file the it tells me that:
Exception in thread "main" java.io.FileNotFoundException: \test.txt (Zugriff verweigert)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at Dropbox.downloadFile(Dropbox.java:73)
at Main.main(Main.java:15)
But I know that this file exists. here is the code for the downloading function
public void downloadFile(String path) throws ListFolderErrorException, DbxException, IOException
{
FileOutputStream out = new FileOutputStream("/test.txt");
DbxDownloader<FileMetadata> downloader = null;
FileMetadata response;
response = downloader.getResult();
try {
InputStream in = downloader.getInputStream();
} finally {
downloader.close();
}
}
Can someonehelp me with that? I can't really find an answer in web.
- Greg-DBDropbox Staff
Based on the stack trace, this error is ocuring in the "new FileOutputStream" line, and not in Dropbox code, so I'm afraid I can't offer much insight.
That said, the "Zugriff verweigert" error seems to translate to "Access denied", so it may be a permissions issue. You'll need to investigate why you don't have permission to access that file, and fix it so that you can.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,910 PostsLatest Activity: 3 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!