如何以编程方式将 dropbox 文件下载到我的 Android 应用程序中
我正在尝试使用 dropbox api 中的 getFileStream() 下载文件,但它返回文件 仅供参考,请帮我下载文件数据。
这是代码..
FileDownload fd = api.getFileStream("dropbox","/public/myfilename.rtf", null);
BufferedReader br = new BufferedReader(new InputStreamReader(fd.is));
BufferedWriter bw = new BufferedWriter(new FileWriter(newfile));
char[] buffer = new char[4096];
int read;
while (true) {
read = br.read(buffer);
if (read <= 0) {
break
}
bw.write(buffer, 0, read);
}
i am trying to download files using getFileStream() in dropbox api but it returns file
information only,please help me to download file data.
here is code..
FileDownload fd = api.getFileStream("dropbox","/public/myfilename.rtf", null);
BufferedReader br = new BufferedReader(new InputStreamReader(fd.is));
BufferedWriter bw = new BufferedWriter(new FileWriter(newfile));
char[] buffer = new char[4096];
int read;
while (true) {
read = br.read(buffer);
if (read <= 0) {
break
}
bw.write(buffer, 0, read);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
并提及你的路径,如“/public/myfilename”,
在我的代码中,我想将其保存为 PDF,所以
我正在创建一个 pdf 并向其写入数据。
and mention your path like "/public/myfilename"
Here in my code i want to save it as a PDF so
i am creating one pdf and writing data to that.