Need to add virus scan logic before upload file

I am trying to make custom logic inside the extension upload folder. The logic is to scan viruses before uploading files. For scanning viruses, I need a temp folder location that has files. I have made an override file to manipulate the existing upload function but in that function, I am not getting the temp folder location. I am new to Strapi, I don’t know how to get the temp folder location. For scanning viruses, I am using the clamscan package.