From 925feaaf95b43f2380a4f375ac9b6419d05732f6 Mon Sep 17 00:00:00 2001
From: Mnikolenko Productengine <mnikolenko@productengine.com>
Date: Thu, 4 Mar 2021 12:06:12 +0200
Subject: [PATCH] SL-14941 FIXED Cannot upload large images on the Simplified
 Cache Viewer.

---
 doc/contributions.txt                  | 1 +
 indra/newview/llviewerassetstorage.cpp | 2 +-
 indra/newview/llviewerassetupload.cpp  | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index bbdfaf655dd..120c737d7a6 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -226,6 +226,7 @@ Ansariel Hiller
 	SL-13364
 	SL-13858
 	SL-13697
+	SL-14941
 Aralara Rajal
 Arare Chantilly
 	CHUIBUG-191
diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp
index 5b76d571965..0f2901406a9 100644
--- a/indra/newview/llviewerassetstorage.cpp
+++ b/indra/newview/llviewerassetstorage.cpp
@@ -291,7 +291,7 @@ void LLViewerAssetStorage::storeAssetData(
         legacy->mUpCallback = callback;
         legacy->mUserData = user_data;
 
-        LLFileSystem file(asset_id, asset_type, LLFileSystem::WRITE);
+        LLFileSystem file(asset_id, asset_type, LLFileSystem::APPEND);
 
         const S32 buf_size = 65536;
         U8 copy_buf[buf_size];
diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp
index 1923e7d6ffe..7b5229d3127 100644
--- a/indra/newview/llviewerassetupload.cpp
+++ b/indra/newview/llviewerassetupload.cpp
@@ -473,7 +473,7 @@ LLSD LLNewFileResourceUploadInfo::exportTempFile()
     infile.open(filename, LL_APR_RB, NULL, &file_size);
     if (infile.getFileHandle())
     {
-        LLFileSystem file(getAssetId(), assetType, LLFileSystem::WRITE);
+        LLFileSystem file(getAssetId(), assetType, LLFileSystem::APPEND);
 
         const S32 buf_size = 65536;
         U8 copy_buf[buf_size];
-- 
GitLab