[File Upload] File name validation before actual upload

Forge Component
(24)
Published on 24 Jan by Renato Pauleta
24 votes
Published on 24 Jan by Renato Pauleta

I am using this File Upload forge component for uploading files on the server. However, this component uploads the file into a temporary folder on the server before this can be used. My use case is to do some validation on the selected file name before even it is uploaded to the TEMP folder. 

Is there any way to do so? 

Hi Shounak Devbhuti,

Can you let me which type of validation you want on file for  name or size or both.


Regards

Rahul Sahu

Rahul Sahu wrote:

Hi Shounak Devbhuti,

Can you let me which type of validation you want on file for  name or size or both.


Regards

Rahul Sahu

Hi Rahul,

I want to validate the name of the selected file for the name to be in a specific format, say, the name should only contain alphabets. This validation should be done on the name before the file is uploaded in the TEMP folder automatically by the widget.


Regards,

Shounak


Hi,


you can modify that component and put JS validation as per ur requirement.


thanks

Hi Shounak Devbhuti,


As JitendraYadav mention, you can alter the JS to include the validation.

If i remember correctly, you can change the Block's JS itself.


Thanks.

JitendraYadav wrote:

Hi,


you can modify that component and put JS validation as per ur requirement.


thanks

Hi Jitendra,

Can you help me by telling me which specific JS to modify? 

Regards,

Shounak


Shounak Devbhuti wrote:

JitendraYadav wrote:

Hi,


you can modify that component and put JS validation as per ur requirement.


thanks

Hi Jitendra,

Can you help me by telling me which specific JS to modify? 

Regards,

Shounak



Ok I'll try and update you