Php + Uploadify has been installed and configured in win7 and can run normally. However, in linux, PHP cannot be uploaded. I am using the YII Framework, which should have no effect.
/* Uploadify background processing method */public function actionuploadify () {// sets the upload directory $ path = ". /uplode/video/"; // $ _ FILES is empty here if (! Empty ($ _ FILES) {// Get the uploaded temporary file stream $ tempFile = $ _ FILES ['filedata'] ['tmp _ name']; // allowed file suffixes $ fileTypes = array ('Av', 'rmvb ', 'mpg', 'wav '); // get the file named $ fileName = iconv ("UTF-8", "GB2312", $ _ FILES ["Filedata"] ["name"]); $ fileParts = pathinfo ($ _ FILES ['filedata'] ['name']); // receives dynamic values $ files =$ _ POST ['typecode']; // Save the server address if (! Is_dir ($ path) mkdir ($ path); // judge whether the singerInfo file exists and is not empty $ this-> getSingFile (); if (move_uploaded_file ($ tempFile, $ path. $ fileName) {$ myfile = explode (". ", $ fileName); $ SQL = $ this-> getfile ($ myfile [0], 1); if ($ SQL) {// Insert a songandSinger document $ songSingerFile = ". /uplode/image/songSinger.txt "; $ this-> getSongFile ($ myfile [0], $ songSingerFile," dSongAndSinger "," kSingerID "); // Insert the songandType file $ songTypeFile = ". /uplode/image/son GType.txt "; $ this-> getSongFile ($ myfile [0], $ songTypeFile," dSongAndType "," kSongTypeID "); // The songandStyle document inserts $ songStyleFile = ". /uplode/image/songStyle.txt "; $ this-> getSongFile ($ myfile [0], $ songStyleFile," dSongAndStyle "," kSongStyleID "); echo $ fileName. "The file is uploaded successfully and the data is uploaded successfully! ";} Else {echo $ fileName." The file is uploaded successfully and data Upload fails! ";}//} Else {echo $ fileName." Upload failed! ";}}}
The following is the html code. Upload the tag.
Upload
Process uploaded js code