예제 #1
0
 /**
  * Save the file to the specified path
  * @return boolean TRUE on success
  */
 function save($path)
 {
     $wpFileSystem = MainWP_Utility::getWPFilesystem();
     if ($wpFileSystem != null) {
         $path = str_replace(MainWP_Utility::getBaseDir(), '', $path);
         $moved = $wpFileSystem->put_contents($path, file_get_contents($_FILES['qqfile']['tmp_name']));
     } else {
         $moved = move_uploaded_file($_FILES['qqfile']['tmp_name'], $path);
     }
     if (!$moved) {
         return false;
     }
     return true;
 }