public function lbt() { $ajax = input::get('ajax',''); if($ajax == '1'){ if(!empty($_FILES)){ $fileDir = public_path().'/test/'; $newFile = $fileDir.$_FILES["myfile"]["name"]; $info = pathinfo($newFile); $type = isset($info['extension']) ? $info['extension'] : false; $allowFiles = array('jpg', 'png', 'gif', 'mp3', 'mp4', 'wav', 'flv'); if(!$type || !in_array($type, $allowFiles)){ echo '文件拓展名不对'; } if($_FILES["myfile"]["error"] == 0){ move_uploaded_file($_FILES["myfile"]["tmp_name"], $newFile); } $data['url'] = url('test/'.$_FILES['myfile']['name']); $imgModel = new ImgModel(); $imgModel->img_name = Input::get('name',''); $imgModel->img_path = $_FILES['myfile']['name']; $imgModel->img_content = ''; $imgModel->save(); }

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 English version
Recommended: Win version, supports code prompts!

Dreamweaver Mac version
Visual web development tools

Atom editor mac version download
The most popular open source editor

Zend Studio 13.0.1
Powerful PHP integrated development environment
