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
Hello sachink2402
What do you mean format? Do you mean the file extension type? If so below the code that would help.
{ a!fileUploadField( label: "File Upload", labelPosition: "ABOVE", target: cons!FOLDER_CONSTANT, saveInto: ri!file, value: ri!file, validations: a!localVariables( local!invalidExtensions: difference(upper(fv!files.extension), "CSV"), if( length(local!invalidExtensions) > 0, "Attachments must be pdf files. Remove: " & index( fv!files, "name", wherecontains( local!invalidExtensions, upper(fv!files.extension) ), {} ), "" ) ) ) }
Validation from documentation. Please refer THIS for more information
docs.appian.com/.../File_Upload_Component.html