diff --git a/data/src/main/java/org/cryptomator/data/cloud/pcloud/PCloudImpl.java b/data/src/main/java/org/cryptomator/data/cloud/pcloud/PCloudImpl.java index 42d53c43..86cb0d97 100644 --- a/data/src/main/java/org/cryptomator/data/cloud/pcloud/PCloudImpl.java +++ b/data/src/main/java/org/cryptomator/data/cloud/pcloud/PCloudImpl.java @@ -205,7 +205,12 @@ class PCloudImpl { public void read(CloudFile file, OutputStream data, final ProgressAware progressAware) throws ApiError, IOException { progressAware.onProgress(Progress.started(DownloadState.download(file))); - FileLink fileLink = client().createFileLink(((PCloudFile) file).getId(), DownloadOptions.DEFAULT).execute(); + Long fileId = ((PCloudFile)file).getId(); + if (fileId == null) { + fileId = client().stat(file.getPath()).execute().fileId(); + } + + FileLink fileLink = client().createFileLink(fileId, DownloadOptions.DEFAULT).execute(); ProgressListener listener = (done, total) -> progressAware.onProgress( // progress(DownloadState.download(file)) //