public async Task <HttpReponseViewModel <bool> > ChunkUpload(IFormFile file)
 {
     return(await Task.Run(async() =>
     {
         return await _uploadServices.ChunkUpload(file, _contextAccessor.HttpContext.Request);
     }));
 }
        public async Task <HttpReponseViewModel <FileUploadResViewModel> > ChunkUpload(IFormFile file)
        {
            HttpReponseViewModel <FileUploadResViewModel> res = new HttpReponseViewModel <FileUploadResViewModel>();
            string identifier       = "";
            int    chunkNumber      = 0;
            int    totalChunks      = 0;
            string fileName         = "";
            int    currentChunkSize = 0;
            int    chunkSize        = 0;
            int    totalSize        = 0;
            string relativePath     = "";

            try
            {
                foreach (var item in Request.Form.Keys)
                {
                    if (item == "chunkNumber")
                    {
                        chunkNumber = Convert.ToInt32(Request.Form["chunkNumber"].ToString());
                    }
                    if (item == "identifier")
                    {
                        identifier = Request.Form["identifier"].ToString();
                    }
                    if (item == "totalChunks")
                    {
                        totalChunks = Convert.ToInt32(Request.Form["totalChunks"].ToString());
                    }
                    if (item == "filename")
                    {
                        fileName = Request.Form["filename"].ToString();
                    }
                    if (item == "chunkSize")
                    {
                        chunkSize = Convert.ToInt32(Request.Form["chunkSize"].ToString());
                    }
                    if (item == "currentChunkSize")
                    {
                        currentChunkSize = Convert.ToInt32(Request.Form["currentChunkSize"].ToString());
                    }
                    if (item == "totalSize")
                    {
                        totalSize = Convert.ToInt32(Request.Form["totalSize"].ToString());
                    }
                    if (item == "relativePath")
                    {
                        relativePath = Request.Form["relativePath"].ToString();
                    }
                }

                FileUploadReqViewModel fileUpload = new FileUploadReqViewModel();
                fileUpload.Identifier       = identifier;
                fileUpload.FileName         = fileName;
                fileUpload.ChunkNumber      = chunkNumber;
                fileUpload.ChunkSize        = chunkSize;
                fileUpload.CurrentChunkSize = currentChunkSize;
                fileUpload.RelativePath     = relativePath;
                fileUpload.TotalChunks      = totalChunks;
                fileUpload.TotalSize        = totalSize;
                fileUpload.File             = file;

                return(await Task.Run(() =>
                {
                    return _fileUploadServices.ChunkUpload(fileUpload);
                }));
            }
            catch (Exception ex)
            {
                res.Flag = false;
                res.Code = 500;
                res.Data = null;
                return(res);
            }
        }