Skip to content

Commit d6397c9

Browse files
989384: Solving the chunck upload issue
1 parent 3377187 commit d6397c9

File tree

2 files changed

+226
-156
lines changed

2 files changed

+226
-156
lines changed

ASPCore-FileManager-WebAPI/ASPCore-FileManager-WebAPI/Controllers/FileManagerController.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,13 @@ public object FileOperations([FromBody] FileManagerDirectoryContent args)
9595
//[HttpPost]
9696
[Route("Upload")]
9797
[Authorize(Roles = "Admin")]
98-
public IActionResult Upload(string path, IList<IFormFile> uploadFiles, string action)
98+
[DisableRequestSizeLimit]
99+
public IActionResult Upload(string path, long size,IList<IFormFile> uploadFiles, string action)
99100
{
100101
FileManagerResponse uploadResponse;
101102
foreach (var file in uploadFiles)
102103
{
103-
var folders = (file.FileName).Split('/');
104+
var folders = (file.FileName ?? string.Empty).Split('/');
104105
// checking the folder upload
105106
if (folders.Length > 1)
106107
{
@@ -115,7 +116,7 @@ public IActionResult Upload(string path, IList<IFormFile> uploadFiles, string ac
115116
}
116117
}
117118
}
118-
uploadResponse = operation.Upload(path, uploadFiles, action, null);
119+
uploadResponse = operation.Upload(path, uploadFiles, action, size);
119120
if (uploadResponse.Error != null)
120121
{
121122
Response.Clear();

0 commit comments

Comments
 (0)