File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
LearningHub.Nhs.WebUI/Services Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 66 using System . Linq ;
77 using System . Net . Http ;
88 using System . Text ;
9+ using System . Text . RegularExpressions ;
910 using System . Threading . Tasks ;
1011 using LearningHub . Nhs . Models . Common ;
1112 using LearningHub . Nhs . Models . Enums ;
@@ -1240,6 +1241,9 @@ public async Task<FileChunkUploadResult> UploadFileChunkAsync(int fileChunkDetai
12401241 {
12411242 if ( fileChunkDetailId == 0 )
12421243 {
1244+ // removing special characters in file name
1245+ string fileNameUpdated = Regex . Replace ( fileName , "[^a-zA-Z0-9.]" , string . Empty ) ;
1246+
12431247 // Store the chunk
12441248 var filelocation = string . Empty ;
12451249 var directoryRef = "chunks_" + Guid . NewGuid ( ) . ToString ( ) ;
@@ -1256,7 +1260,7 @@ public async Task<FileChunkUploadResult> UploadFileChunkAsync(int fileChunkDetai
12561260 FilePath = filelocation ,
12571261 ChunkCount = chunkCount ,
12581262 ResourceVersionId = ( resourceVersionId == 0 ) ? ( int ? ) null : resourceVersionId ,
1259- FileName = fileName ,
1263+ FileName = fileNameUpdated ,
12601264 FileSizeKb = ( int ) ( fileSize / 1000 ) ,
12611265 } ) ;
12621266 }
You can’t perform that action at this time.
0 commit comments