1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

All: Resolves #2097: Add warning message when user tries to upload a file 10MB or larger (#2102)

This commit is contained in:
Marcus Hill
2019-11-20 10:18:58 -08:00
committed by Laurent Cozic
parent 37fc42eb73
commit e84bafd034

View File

@ -424,6 +424,11 @@ class Synchronizer {
const result = await Resource.fullPathForSyncUpload(local);
local = result.resource;
const localResourceContentPath = result.path;
if (local.size >= 10 * 1000* 1000) {
this.logger().warn(`Uploading a large resource (resourceId: ${local.id}, size:${local.size} bytes) which may tie up the sync process.`);
}
await this.api().put(remoteContentPath, null, { path: localResourceContentPath, source: 'file' });
} catch (error) {
if (error && ['rejectedByTarget', 'fileNotFound'].indexOf(error.code) >= 0) {