Expand my Community achievements bar.

SOLVED

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

Avatar

Level 10

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,

1 Accepted Solution

Avatar

Correct answer by
Level 10
6 Replies

Avatar

Employee Advisor

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

Avatar

Level 10

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,

Avatar

Level 10

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? 

Avatar

Employee Advisor

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

Avatar

Level 10

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

Avatar

Correct answer by
Level 10