コード例 #1
0
ファイル: develop.view.php プロジェクト: bizonix/sailvan
 public function view_uploadPic()
 {
     F("dp");
     if (isset($_REQUEST["PHPSESSID"])) {
         session_id($_REQUEST["PHPSESSID"]);
     }
     $dpInfo = A("DistributorBasicInformation")->act_getDistributorBasicInformationById();
     $loginName = $dpInfo['email'];
     $uploadName = $_POST['uploadPicName'];
     $baseDir = C("DISTRIBUTOR_KEY_PICTURE_DIR") . $loginName . "/";
     del_picByName($uploadName);
     $time = time();
     $suffixArr = array('jpg', 'jpeg', 'gif', 'bmp', 'png');
     //var_dump($_FILES);exit;
     $flag = uploadFile("Filedata", $baseDir, $uploadName . $time, $suffixArr);
     $name = get_getSuffixByName($uploadName . $time, $loginName);
     echo $this->ajaxReturn(array("name" => $uploadName, "ret" => $flag, "url" => '/images/distributor/' . $loginName . '/' . $name));
 }
コード例 #2
0
 public function view_uploadPic()
 {
     F("dp");
     if (isset($_REQUEST["PHPSESSID"])) {
         session_id($_REQUEST["PHPSESSID"]);
     }
     $loginName = json_decode(_authcode($_COOKIE['hcUser']), true);
     $loginName = $loginName['email'];
     $uploadName = $_POST['uploadPicName'];
     $baseDir = C("DISTRIBUTOR_KEY_PICTURE_DIR") . $loginName . "/";
     del_picByName($uploadName);
     $time = time();
     $suffixArr = array('jpg', 'jpeg', 'gif', 'bmp', 'png');
     $flag = uploadFile("Filedata", $baseDir, $uploadName . $time, $suffixArr);
     $name = get_getSuffixByName($uploadName . $time);
     echo $this->ajaxReturn(array("name" => $uploadName, "ret" => $flag, "url" => '/images/distributor/' . $loginName . '/' . $name));
 }