Вопрос по php – Ограничение условия проверки при загрузке SWF-файлов

0

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceededvideo/swfError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

<?php
        foreach($_FILES['item_swf']['tmp_name'] as $key=>$val)
        {

        list($width, $height) = getimagesize($_FILES['item_swf']['tmp_name'][$key]);

        if (( ($_FILES["item_swf"]["type"][$key] == "video/swf") || ($_FILES["item_swf"]["type"][$key] == "video/SWF") )
        && ($_FILES["item_swf"]["size"][$key] < 800000))
           {
                if ($_FILES["item_swf"]["error"][$key] > 0)
                  {
                     echo "Error: " . $_FILES["item_swf"]["error"][$key] . "<br />";
                  }
                else if($width==1000 && $height==328)
                  {
                   if (file_exists('../../swf_folder/header_swf/' . $_FILES["item_swf"]["name"]))
                            {
                               echo $_FILES["item_swf"]["name"][$key] . " already exists. ";
                             }
                   else
                            { 

                               move_uploaded_file($val, '../../swf_folder/header_swf/'.$_FILES['item_swf']['name'][$key]);
                               echo "done";
                        }
                  }
             else 
                 {
                    echo "size doest permit";
                 }  
            }
        else
            {
               echo "Not a valid swf file::";
            }                       

        }
        ?>

Error: User Rate Limit Exceeded

move_uploaded_file($val, '../../swf_folder/header_swf/'.$_FILES['item_swf']['name'][$key]);

Error: User Rate Limit Exceeded

Edit

Error: User Rate Limit Exceededvideo/swfError: User Rate Limit Exceededapplication/x-shockwave-flash.

Error: User Rate Limit Exceeded

<?php
        foreach($_FILES['item_swf']['tmp_name'] as $key=>$val)
        {

        list($width, $height) = getimagesize($_FILES['item_swf']['tmp_name'][$key]);

        if (($_FILES["item_swf"]["type"][$key] == "application/x-shockwave-flash") 
        && ($_FILES["item_swf"]["size"][$key] < 800000))
           {
                if ($_FILES["item_swf"]["error"][$key] > 0)
                  {
                     echo "Error: " . $_FILES["item_swf"]["error"][$key] . "<br />";
                  }
                else if($width==1000 && $height==328)
                  {
                   if (file_exists('../../swf_folder/header_swf/' . $_FILES["item_swf"]["name"]))
                            {
                               echo $_FILES["item_swf"]["name"][$key] . " already exists. ";
                             }
                   else
                            { 

                               move_uploaded_file($val, '../../swf_folder/header_swf/'.$_FILES['item_swf']['name'][$key]);
                               echo "done";
                        }
                  }
             else 
                 {
                    echo "size doest permit";
                 }  
            }
        else
            {
               echo "Not a valid swf file::";
            }                       

        }
        ?>
Error: User Rate Limit Exceeded Saswat
../../Error: User Rate Limit Exceeded Baba
Error: User Rate Limit Exceeded Baba

Ваш Ответ

2   ответа
0

video/swfapplication/x-shockwave-flash

<?php
        foreach($_FILES['item_swf']['tmp_name'] as $key=>$val)
        {

        list($width, $height) = getimagesize($_FILES['item_swf']['tmp_name'][$key]);

        if (( ($_FILES["item_swf"]["type"][$key] == "application/x-shockwave-flash") || ($_FILES["item_swf"]["type"][$key] == "video/SWF") )
        && ($_FILES["item_swf"]["size"][$key] < 800000))
           {
                if ($_FILES["item_swf"]["error"][$key] > 0)
                  {
                     echo "Error: " . $_FILES["item_swf"]["error"][$key] . "<br />";
                  }
                else if($width==1000 && $height==328)
                  {
                   if (file_exists('../../swf_folder/header_swf/' . $_FILES["item_swf"]["name"]))
                            {
                               echo $_FILES["item_swf"]["name"][$key] . " already exists. ";
                             }
                   else
                            { 

                               move_uploaded_file($val, '../../swf_folder/header_swf/'.$_FILES['item_swf']['name'][$key]);
                               echo "done";
                        }
                  }
             else 
                 {
                    echo "size doest permit";
                 }  
            }
        else
            {
               echo "Not a valid swf file::";
            }                       

        }
        ?>
1

$savePath = "PATH_TO_SAVE";
$errors = array ();
$output = array ();
//

if (isset ( $_FILES ['item_swf'])) {

    foreach ( $_FILES ['item_swf'] ['tmp_name'] as $key => $val ) {

        $fileName = $_FILES ['item_swf'] ['name'] [$key];
        $fileSize = $_FILES ['item_swf'] ['size'] [$key];
        $fileTemp = $_FILES ['item_swf'] ['tmp_name'] [$key];

        $fileExtention = pathinfo ( $fileName, PATHINFO_EXTENSION );
        $fileExtention = strtolower ( $fileExtention );

        if ($fileExtention != ".swf") {
            $errors [$fileName] [] = "Invalid File Extention";
            continue;
        }

        if ($fileSize > 800000) {
            $errors [$fileName] [] = "File Too large";
            continue;
        }

        list ( $width, $height ) = getimagesize ( $fileTemp );

        if ($width != 1000 && $height != 328) {
            $errors [$fileName] [] = "Wrong File dimention ";
            continue;
        }

        if (file_exists ( $savePath . DIRECTORY_SEPARATOR . $fileName )) {
            $errors [$fileName] [] = "File Exist";
            continue;
        }

        if(!is_writable($savePath ))
        {
            $errors [$fileName] [] = "File Destination not writeable";
        }


        if(count($errors [$fileName]) == 0)
        {
            if(@move_uploaded_file ( $fileTemp, $savePath . DIRECTORY_SEPARATOR . $fileName))
            {
                $output[$fileName] == "OK" ;
            }
            else
            {
                $errors [$fileName] [] = "Error Saving File";
            }

        }


    }
        var_dump($errors, $output);
}

Похожие вопросы