Laravel 프레임워크 - 업로드 파일 업로드 판단 형식 및 크기

"text/javascript"</span>>
    <?php $timestamp = time();?>
    $(function() {
        $(<span class="hljs-string">'#uploadFile'</span>).uploadify({
            <span class="hljs-string">'buttonText'</span> : <span class="hljs-string">' '</span>,
            <span class="hljs-string">'formData'</span>     : {
                <span class="hljs-string">'timestamp'</span> : <span class="hljs-string">'<?php echo $timestamp;?>'</span>,
                <span class="hljs-string">'_token'</span>     : <span class="hljs-string">'{{ csrf_token() }}'</span>
            },
            <span class="hljs-string">'swf'</span>      : <span class="hljs-string">"{{ asset('resources/org/uploadify/uploadify.swf') }}"</span>,
            <span class="hljs-string">'uploader'</span> : <span class="hljs-string">"{{ url('admin/uploadFile') }}"</span>,
            <span class="hljs-string">'onUploadSuccess'</span> : uploadFile,
        });
        function uploadFile(file, data) {
            var data = $.parseJSON(data);
            <span class="hljs-keyword">if</span>(data.code==<span class="hljs-number">0</span>){
                $(<span class="hljs-string">"#error_msg"</span>).show();
                $(<span class="hljs-string">"#error_msg"</span>).html(data.msg);
            }
            <span class="hljs-keyword">else</span>{
                $(<span class="hljs-string">"#error_msg"</span>).hide();
                $(<span class="hljs-string">'input[name=fail_file]'</span>).val(data.path);
                $(<span class="hljs-string">'input[name=fail_size]'</span>).val(data.size);
            }
        }
    });

좋은 웹페이지 즐겨찾기