Hi Guys, I'm bit new to PHP and trying to build a PHP application with:
1. Select Excel file from any where in C drive and Upload into Loader folder functionality
2. While uploading, do McAfee scan to make sure the file is clean.
Any example would be very helpful.
Many thanks for your time.
Upload Excel file using PHP application
Moderator: General Moderators
Re: Upload Excel file using PHP application
For the first part read how to upload a file. The user should know be able to find the file. As for the virus scan, I doubt that would be needed because I am assuming that you would be splitting the file (using explode,etc) to find data that you need from it,etc. Unless you are executing it on excel, I don't think viruses should be a big concern. In the very worst case,if the server is a windows machine,it will catch it.khhalid wrote:Hi Guys, I'm bit new to PHP and trying to build a PHP application with:
1. Select Excel file from any where in C drive and Upload into Loader folder functionality
2. While uploading, do McAfee scan to make sure the file is clean.
Any example would be very helpful.
Many thanks for your time.
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: Upload Excel file using PHP application
Here's a tutorial on uploading.
http://www.w3schools.com/PHP/php_file_upload.asp
As a94060 said, if you're just parsing the file in PHP, there's no need to scan it. If you need to scan it for sure, you can call command line programs with shell_exec()
http://www.php.net/manual/en/function.shell-exec.php
http://www.w3schools.com/PHP/php_file_upload.asp
As a94060 said, if you're just parsing the file in PHP, there's no need to scan it. If you need to scan it for sure, you can call command line programs with shell_exec()
http://www.php.net/manual/en/function.shell-exec.php
Re: Upload Excel file using PHP application
Thank you guys,
I am now able to upload files but scan bit still in the air.
I am uploading Excel file and scan it then move into "Scanned" folder.
Here are the codes I am using:
<?php
echo "start scanning" . "<br/>";
$return = array();
$tmp = exec("C:\\Program Files\\McAfee\\VirusScan Enterprise\\csscan.exe -c C:\\48SchemeTemplate.xls", $return); // Double backslash is needed to escape them
foreach( $return AS $line ) {
echo "$line<br>\n";
}
echo "done."
?>
I want to read the output but when I run the php file with above codes, this displays my messages (i.e. 'stat scanning' and 'done.') and not reading the output from $return.
I use cmd line and enter 'csscan.exe -c C:\\48SchemeTemplate.xls' and the output return number of lines (see attachment).
Any idea what I am missing here??
Many thanks for your time,
I am now able to upload files but scan bit still in the air.
I am uploading Excel file and scan it then move into "Scanned" folder.
Here are the codes I am using:
<?php
echo "start scanning" . "<br/>";
$return = array();
$tmp = exec("C:\\Program Files\\McAfee\\VirusScan Enterprise\\csscan.exe -c C:\\48SchemeTemplate.xls", $return); // Double backslash is needed to escape them
foreach( $return AS $line ) {
echo "$line<br>\n";
}
echo "done."
?>
I want to read the output but when I run the php file with above codes, this displays my messages (i.e. 'stat scanning' and 'done.') and not reading the output from $return.
I use cmd line and enter 'csscan.exe -c C:\\48SchemeTemplate.xls' and the output return number of lines (see attachment).
Any idea what I am missing here??
Many thanks for your time,
- Attachments
-
- scan.JPG (69.42 KiB) Viewed 3722 times
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: Upload Excel file using PHP application
Not sure. It seems like it should be giving the response. Try $return = shell_exec();
Re: Upload Excel file using PHP application
Re: Upload Excel file using PHP application
I am now using different utility from McAFee, Command Line Scanner, to return the output and that seem to working.
Thank you guys for your time.
Thank you guys for your time.