Uedit Rich Text editor image upload image server

Source: Internet
Author: User

Uedit settings

Modifying the uploader class

Source code this comment

$url= "upimg.com/uploadimg.php"; $tmpName=$file[' Name '];//file name on upload        $tmpFile=$file[' Tmp_name '];//temporary storage path on upload        $tmpType=$file[' type '];//types of files uploaded        $folder= ' Goods_uedit ';//Storage Path//perform upload        $data= Json_decode ($this->upload_file ($url,$tmpName,$tmpFile,$tmpType,$folder)); if($data-code) {            $this->filename =$data-name; $t= Time(); $d=Explode(‘-‘,Date("Y-y-m-d-h-i-s")); $format=$this->config["Pathformat"]; $format=Str_replace("{yyyy}",$d[0],$format); $format=Str_replace("{yy}",$d[1],$format); $format=Str_replace("{mm}",$d[2],$format); $format=Str_replace("{DD}",$d[3],$format); $format=Str_replace("{hh}",$d[4],$format); $format=Str_replace("{II}",$d[5],$format); $format=Str_replace("{SS}",$d[6],$format); $format=Str_replace("{Time}",$t,$format); $this->fullname =$format.$data-name; $this->stateinfo = ' SUCCESS '; }

    functionUpload_file ($url,$filename,$path,$type,$folder){          //PHP 5.5 and above usage        if(class_exists(' \curlfile ')) {              $data=Array(                ' IMGs ' =New\curlfile (Realpath($path),$type,$filename), ' folder ' =$folder            ); } Else {              $data=Array(                  ' IMGs ' = ' @ '.Realpath($path)."; Type= ".$type."; Filename= ".$filename, ' folder ' =$folder            ); }        $ch=Curl_init (); curl_setopt ($ch, Curlopt_url,$url); curl_setopt ($ch, Curlopt_post,true); curl_setopt ($ch, Curlopt_postfields,$data); curl_setopt ($ch, Curlopt_header,false); curl_setopt ($ch, Curlopt_returntransfer,true); $return _data= Curl_exec ($ch); $return _data=Trim($return _data); Curl_close ($ch); return $return _data; }

Uedit Rich Text editor image upload image server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.