Antivirus/Malware Scan before Reading File Uploaded-AEM+Apache File upload Integration | Community
Skip to main content
Level 9
October 16, 2015
Solved

Antivirus/Malware Scan before Reading File Uploaded-AEM+Apache File upload Integration

  • October 16, 2015
  • 6 replies
  • 3114 views

Hello,

I am trying to upload files using apache file upload but without storing files in AEM, i am reading and parsing the contents of the file.

Now i want to be able to scan for any malware or viruses before i begin reading or before i upload, can i get some advice here please.

Please let me know any best practices or suggestions, so as to avoid the user from dumping a malicious file apart from size and mime type check

Regards,

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

http://stackoverflow.com/questions/4721406/scan-file-with-antivirus-on-upload-java

that discussess the subject. 

6 replies

joerghoh
Adobe Employee
Adobe Employee
October 16, 2015

Hi,

where do you want to store the files on the server? You have to upload the files first before you can scan them.

kind regards,
Jörg

Level 9
October 16, 2015

Jörg Hoh wrote...

Hi,

where do you want to store the files on the server? You have to upload the files first before you can scan them.

kind regards,
Jörg

 

Hello Jorg,

When the user clicks the upload /browse field , which is  available on publish environment the user can upload files from their filesystem,

I am using Apache file upload, I retrieve the file input stream and then Apache LineIterator to parse individual lines, and thereby parsing the entire file, without having to store it in aem or server before parsing/opening the file stream, but i would like to scan it before i begin to read it or after one has uploaded the file

Please let me know

Regards,

smacdonald2008
Level 10
October 16, 2015

You want to scan the file after the user has selected the file to upload.  In other words - you want to scan it dynamically after the user has selected and uploaded - but before you process it on the server? 

joerghoh
Adobe Employee
Adobe Employee
October 16, 2015

So you plan to scan the inputstream originating from the browser? Sounds interesting, but IMHO this isn't an AEM topic in the first place. AEM does not provide a virus or malware scanner, so you need to provide one, which supports scanning streams and not only files.

kind regards,
Jörg

Level 9
October 16, 2015

smacdonald2008 wrote...

You want to scan the file after the user has selected the file to upload.  In other words - you want to scan it dynamically after the user has selected and uploaded - but before you process it on the server? 

 

 

 

Yes Scott, your right, i referred your blog to upload file using apache file upload, and now i was wondering if there could be a good approach that adobe could recommend to achieve this kind of functionality

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015