2017/04/06

Doctrine form ашиглалгүйгээр file upload хийх

<?php
foreach ($request->getFiles() as $fileName) {

            $fileSize = $fileName['size'];
            $fileType = $fileName['type'];
            $theFileName = $fileName['name'];
            $uploadDir = sfConfig::get("sf_upload_dir");
            $Contacts_uploads = $uploadDir.'/contacts_uploads';

            if(!is_dir($Contacts_uploads))
                mkdir($Contacts_uploads, 0777);            

            move_uploaded_file($fileName['tmp_name'], "$Contacts_uploads/$theFileName");

        }
?>

1 comment:

  1. Casinos Near Harrah's Casino - Mapyro
    Find 속초 출장샵 Casinos Near Harrah's 김천 출장안마 Casino, Harrah's Cherokee in North Carolina - Find 원주 출장샵 Casinos Near Harrah's Casino, NC, 공주 출장샵 Murphy, 여주 출장마사지 NC.

    ReplyDelete

Миний бичсэн бичлэг танд өчүүхэн ч болтугай хэрэг болсон бол сэтгэгдлээ бичиж үлдээхийг хүсье. Баярлалаа :)