mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-04 15:02:25 +02:00
Resolve onedrive crash when uploading files that exceed the allowed OneDrive individual file limit
This commit is contained in:
parent
570d42269e
commit
fec7654118
15
src/sync.d
15
src/sync.d
|
@ -854,6 +854,20 @@ final class SyncEngine
|
|||
// Check the database for the parent
|
||||
enforce(itemdb.selectByPath(dirName(path), defaultDriveId, parent), "The parent item is not in the local database");
|
||||
|
||||
// Maximum file size upload
|
||||
// https://support.microsoft.com/en-au/help/3125202/restrictions-and-limitations-when-you-sync-files-and-folders
|
||||
// 1. OneDrive Business say's 15GB
|
||||
// 2. Another article updated April 2018 says 20GB:
|
||||
// https://answers.microsoft.com/en-us/onedrive/forum/odoptions-oddesktop-sdwin10/personal-onedrive-file-upload-size-max/a3621fc9-b766-4a99-99f8-bcc01ccb025f
|
||||
|
||||
// Use smaller size for now
|
||||
auto maxUploadFileSize = 16106127360; // 15GB
|
||||
//auto maxUploadFileSize = 21474836480; // 20GB
|
||||
auto thisFileSize = getSize(path);
|
||||
|
||||
if (thisFileSize <= maxUploadFileSize){
|
||||
// Resolves: https://github.com/skilion/onedrive/issues/121, https://github.com/skilion/onedrive/issues/294, https://github.com/skilion/onedrive/issues/329
|
||||
|
||||
// To avoid a 409 Conflict error - does the file actually exist on OneDrive already?
|
||||
JSONValue fileDetailsFromOneDrive;
|
||||
|
||||
|
@ -914,6 +928,7 @@ final class SyncEngine
|
|||
saveItem(fileDetailsFromOneDrive);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void uploadDeleteItem(Item item, string path)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue