Use the Kindeditor operation in the SAE in the PHP environment Stroge

Source: Internet
Author: User

the SAE has its own cloud storage Storage , first open storage, and then create a new Domain , and named (hereinafter named "uploads").

2. Change the upload file upload_json.php in Kindeditor.

(1), in require_once ' json.php '; add the following code:

if (Isset ($_server[' http_appname ')) $issae = true; Whether Sina cloud Platform else$issae = false; $domain = ' kindeditor '; Picture Domain name

(2), in {Check directory, check directory write permissions} and {Create folder} plus if judgment, determine if it is SAE, when not the SAE to execute the original code: if (! $issae);

(3), {Move file} Plus judge whether it is non-SAE, non-SAE to execute the original code, if the SAE executes the following code:

$s = new saestorage ();   $r = $s->upload ($domain, $new _file_name, $tmp _name); if (! $r) alert ("The Sina Cloud platform failed to upload the file, please check that the domain settings are correct.")  "); $file _url = $s->geturl ($domain, $new _file_name);

The above three steps can be uploaded to the SAE storage domain kindeditor.



Use the Kindeditor operation in the SAE in the PHP environment Stroge

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.