13
Views
6
Comments
Solved
[ReactFilePondUpload] how to prevent paste by using control + v in document file upload on FilePondUploadJS
reactfilepondupload
Reactive icon
Forge asset by Stuart Harris
Application Type
Reactive

Hi, 

I am facing issue in file upload when i try to copy text in excel table, then click on control plus V in screen it is automatically uploading file upload document. So advise some solution thanks in advance PFA

Thanks,
Prasath P

2023-12-16 19-57-03
Sanjay Kushwah
Solution

Hi @Prasath P,

I have updated the code in component's JS file (filePondUploadPlugin.js) and tested also create a screen and now it is working as expected. 

Now pasting file using control + v has been prevented.

in filePondUploadPlugin.js file just change little code that highlighted in the image below.

just change,

from

allowPaste: options.AllowDrop !== false 

to

allowPaste: options.AllowDrop !== true,

I am also attaching working OML file of this component where I have also created a screen (Home).

here control + v is prevented.


Hope this will help you.

Kind regards,

Sanjay Kushwah

ReactFilePondUpload_CW.oml
2023-12-16 19-57-03
Sanjay Kushwah

Hi @Prasath P,

Could you please explain more what is exact issue as I see this component, it is working fine, while pressing ctrl+V there is nothing happening.


Kind regards,

Sanjay Kushwah

2025-01-23 05-55-15
Prasath P

Hi @Sanjay Kushwah

i will provide steps:
step1: copy word from excel

step2: paste it in screen. it replicating automatically document is uploaded.


2023-12-16 19-57-03
Sanjay Kushwah

Could you please attach your OML file.


2025-01-23 05-55-15
Prasath P
2025-01-23 05-55-15
Prasath P

hi @Sanjay Kushwah

Please find attachmet

ReactFilePondUpload.oap
2023-12-16 19-57-03
Sanjay Kushwah
Solution

Hi @Prasath P,

I have updated the code in component's JS file (filePondUploadPlugin.js) and tested also create a screen and now it is working as expected. 

Now pasting file using control + v has been prevented.

in filePondUploadPlugin.js file just change little code that highlighted in the image below.

just change,

from

allowPaste: options.AllowDrop !== false 

to

allowPaste: options.AllowDrop !== true,

I am also attaching working OML file of this component where I have also created a screen (Home).

here control + v is prevented.


Hope this will help you.

Kind regards,

Sanjay Kushwah

ReactFilePondUpload_CW.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.