diff --git a/functionality/filesharing/filesharing_functionality.go b/functionality/filesharing/filesharing_functionality.go index e3b7f42..ed726d0 100644 --- a/functionality/filesharing/filesharing_functionality.go +++ b/functionality/filesharing/filesharing_functionality.go @@ -272,15 +272,21 @@ func (f *Functionality) DownloadFile(profile peer.CwtchPeer, conversationID int, } // Don't download files if the download file directory does not exist - if _, err := os.Stat(path.Dir(downloadFilePath)); os.IsNotExist(err) { - return errors.New("download directory does not exist") - } + // Unless we are on Android where the kernel wishes to keep us ignorant of the + // actual path and/or existence of the file. We handle this case further down + // the line when the manifest is received and protocol engine and the Android layer + // negotiate a temporary local file -> final file copy. We don't want to worry + // about that here... + if runtime.GOOS != "android" { + if _, err := os.Stat(path.Dir(downloadFilePath)); os.IsNotExist(err) { + return errors.New("download directory does not exist") + } - // Don't download files if the manifest file directory does not exist - if _, err := os.Stat(path.Dir(manifestFilePath)); os.IsNotExist(err) { - return errors.New("manifest directory does not exist") + // Don't download files if the manifest file directory does not exist + if _, err := os.Stat(path.Dir(manifestFilePath)); os.IsNotExist(err) { + return errors.New("manifest directory does not exist") + } } - // Store local.filesharing.filekey.manifest as the location of the manifest profile.SetScopedZonedAttribute(attr.LocalScope, attr.FilesharingZone, fmt.Sprintf("%s.manifest", key), manifestFilePath)