mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 03:32:15 -05:00
create file and dirs before creating file
This commit is contained in:
parent
8fe3b2974b
commit
66abdfccd4
@ -149,6 +149,8 @@ public class FileBackend {
|
||||
String extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(mime);
|
||||
message.setRelativeFilePath(message.getUuid() + "." + extension);
|
||||
DownloadableFile file = mXmppConnectionService.getFileBackend().getFile(message);
|
||||
file.getParentFile().mkdirs();
|
||||
file.createNewFile();
|
||||
OutputStream os = new FileOutputStream(file);
|
||||
InputStream is = mXmppConnectionService.getContentResolver().openInputStream(uri);
|
||||
byte[] buffer = new byte[1024];
|
||||
|
Loading…
Reference in New Issue
Block a user