This commit is contained in:
2021-08-30 17:47:13 +00:00
parent d962931512
commit dc0edf3fee
2 changed files with 33 additions and 1 deletions

View File

@@ -5507,6 +5507,13 @@ namespace AyaNova.PlugIn.V8
progress.SubOp("Wikifile: \"" + af.Name + "\" " + AyaBizUtils.FileSizeDisplay((decimal)af.FileSize));
if (IsDuplicatev7v8IdMapItem(i.LT_O_AyaFile.Value, i.LT_O_AyaFile.Display, progress)) continue;
if (af.FileSize > SmallestFileUploadRejectedAsTooBig)
{
progress.Append("WIKI Attachment file " + i.LT_O_AyaFile.Display + " too large (" + af.FileSize.ToString() + ") for this server. Adjust destination server settings to allow");
continue;
}
//Compile the FileData property
var sDate = i.LT_Common_Label_Created.ToString();
DateTimeOffset dtLastModified = DateTime.UtcNow;
@@ -5563,7 +5570,30 @@ namespace AyaNova.PlugIn.V8
formDataContent.Add(AttachmentFile);
//Upload
var a = await util.PostFormDataAsync("attachment", formDataContent);
util.ApiResponse a = null;
try
{
a=await util.PostFormDataAsync("attachment", formDataContent);
}
catch (Exception ex)
{
if (ex.Message.Contains("413"))
{
if (SmallestFileUploadRejectedAsTooBig > af.FileSize)
SmallestFileUploadRejectedAsTooBig = af.FileSize;
progress.Append("WIKI Attachment file " + i.LT_O_AyaFile.Display + " too large (" + af.FileSize.ToString() + ") for this server. Adjust destination server settings to allow");
continue;
}
else
{
throw;
}
}
//Map it for later processing of wiki
//attachment upload route returns all attachments for this object in file name order
//so need to find *our* most recent uploaded attachment so need to find the highest raven id number

View File

@@ -359,6 +359,8 @@ namespace AyaNova.PlugIn.V8
}
catch (Exception ex)
{
if (ex.Message.Contains("413")) throw;//too large, no point in retrying at all let upstream caller handle it immediately
if (FirstException == null)
FirstException = ex;
}