Skip to content

Commit 90a2f14

Browse files
authored
Merge pull request #915 from bcgov/bug/DSS-1168
DSS-1168 Update Error Message
2 parents ce52d9a + 3f70d80 commit 90a2f14

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

server/StrDss.Api/Controllers/BizLicencesController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public async Task<ActionResult> UploadBizLicences([FromForm] PlatformDataUploadD
4848

4949
if (!CommonUtils.IsTextFile(dto.File.ContentType))
5050
{
51-
errors.AddItem("File", $"Uploaded file is not a text file.");
51+
errors.AddItem("File", $"Uploaded file is not a CSV file.");
5252
return ValidationUtils.GetValidationErrorResult(errors, ControllerContext);
5353
}
5454

server/StrDss.Api/Controllers/RegistrationController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public async Task<ActionResult> UploadValidateRegistration([FromForm] ValidateRe
4444

4545
if (!CommonUtils.IsTextFile(dto.File.ContentType))
4646
{
47-
errors.AddItem("File", $"Uploaded file is not a text file.");
47+
errors.AddItem("File", $"Uploaded file is not a CSV file.");
4848
return ValidationUtils.GetValidationErrorResult(errors, ControllerContext);
4949
}
5050

server/StrDss.Api/Controllers/RentalListingReportsController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public async Task<ActionResult> CreateRentalLisingReport([FromForm] PlatformData
4545

4646
if (!CommonUtils.IsTextFile(dto.File.ContentType))
4747
{
48-
errors.AddItem("File", $"Uploaded file is not a text file.");
48+
errors.AddItem("File", $"Uploaded file is not a CSV file.");
4949
return ValidationUtils.GetValidationErrorResult(errors, ControllerContext);
5050
}
5151

server/StrDss.Api/Controllers/RentalListingsController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public async Task<ActionResult> UploadTakedownConfrimation([FromForm] PlatformDa
206206

207207
if (!CommonUtils.IsTextFile(dto.File.ContentType))
208208
{
209-
errors.AddItem("File", $"Uploaded file is not a text file.");
209+
errors.AddItem("File", $"Uploaded file is not a CSV file.");
210210
return ValidationUtils.GetValidationErrorResult(errors, ControllerContext);
211211
}
212212

server/StrDss.Common/CommonUtils.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@ public static T CloneObject<T>(T obj)
3333

3434
public static bool IsTextFile(string contentType)
3535
{
36-
return contentType == "text/plain" ||
37-
contentType == "text/csv" ;
36+
return contentType == "text/plain"
37+
|| contentType == "text/csv"
38+
|| contentType == "application/csv"
39+
|| contentType == "application/vnd.ms-excel"
40+
|| contentType == "application/x-csv"
41+
|| contentType == "text/x-csv"
42+
|| contentType == "text/tab-separated-values"
43+
|| contentType == "application/octet-stream";
3844
}
3945

4046
public static string StreamToBase64(Stream stream)

0 commit comments

Comments
 (0)