Hi Everyone,
I want implement a validation on file upload field, whenever user uploads a CSV file system will validate and check whether the CSV file uploaded is in correct format or not ?
if file is not in correct format system will give the error "File is not in correct format"
Discussion posts and replies are publicly visible
Hi Sachin,You can add the following code in validations parameter of a!fileUploadfield() that will check where the file is in .csv format code:
validations: { a!localVariables( local!invalidExtensions: difference( upper(fv!files.extension), { "CSV"} ),
if( length(local!invalidExtensions) > 0, "Please upload supported file formats: CSV", "" ) ) }