android - Dropbox file download fails -
i trying download file dropbox using dropbox sdk android.
i added following permission in manifest:
<uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.read_external_storage"/> <uses-permission android:name="android.permission.write_external_storage"/>
following code using download file:
file mfile=new file(environment.getexternalstoragedirectory().getpath()); try { fileoutputstream mfileoutputstream=new fileoutputstream(mfile); dropboxfileinfo mdropboxfileinfo=mdropboxapi.getfile("/"+filename, null, mfileoutputstream, null); } catch (filenotfoundexception e) { // todo auto-generated catch block e.printstacktrace(); } catch (dropboxexception e) { // todo auto-generated catch block e.printstacktrace(); }
you passing directory name in mfile
variable. think should append file name after directory path. resolve problem.
Comments
Post a Comment