PxPlus User Forum

Twitter Twitter Twitter

Author Topic: File Upload  (Read 1675 times)

bteixeira

  • Silver Member
  • ***
  • Posts: 27
    • View Profile
File Upload
« on: January 08, 2019, 04:22:46 PM »
Mainly looking for best practices when using the %inomads'upload_file() method.  We want to limit file type and file size on an upload.  We'd also want to scan the file for viruses.  I don't see anything in the inomads documentation that does any of this.  Is there a way to limit file type/size.  Can iNomads integrate with a virus scanner? 

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: File Upload
« Reply #1 on: January 09, 2019, 09:07:33 AM »
There is no built-in method to limit file size or scan for viruses but you can do both of these yourself once the file has been uploaded (which is what mamy sites do at least for anti-virus).

What I would generally do is once the file is uploaded, open it (or read the directory) to get its file length.  If too large erase the file and advise the client.

As for anti-virus, it all depends on what anti-virus tools you want and have purchased.  Most have some form of command line utility you can call to check for viruses,  You would need to check with the anti-virus supplier for details. 

If you want a free option or need this for Linux have a look at ClamAV.

It is important to make sure whatever you chose to use for anti-virus protection gets updated regularly.

Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com