View Full Version : Help with php script

10-17-2012, 06:00 PM
Hi, I wrote a php script to upload docx, doc , pdf file to the server in abc folder and i want that file to be renamed with the name of uploader with uploading date as prefix. When i run it , it shows me error in line 13 and 14.Please help me . Thanks in advance.

define("UPLOAD_DIR", "C:\wamp\www\abc\""); ///home/mgcons/my_file_uploads
if(!empty($_FILES["uploaded_file"] )){
if ($myFile["error"] !== UPLOAD_ERR_OK){
echo "<p>An error occurred.</p>";
$ab=date("d m Y",$day);
echo "Unable to save file.";
chmod(UPLOAD_DIR . $file_name, 644);
$mime="application/pdf; charset=binary"."application/vnd.openxmlformats-officedocument.wordprocessingml.document"."application/vnd.ms-word.document.macroEnabled.12"."application/vnd.openxmlformats-officedocument.wordprocessingml.template"."application/vnd.ms-word.template.macroEnabled.12"."application/msword";
exec("file -bi " . $_FILES["$myFile"]["tmp_name"], $out);
if($out[0] != $mime){
echo "File is not supported";
exec("clamscan --stdout ". $_FILES["$myFile"]["tmp_name"], $out, $return);
if ($return){
echo "This file is infected";

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum