sae-uploading local images to SAE's version storagephp

Source: Internet
Author: User
Sina's SAE is in a secure period and does not support the SAE that uploads local files directly.


That is, you cannot select files by selecting the File button, after clicking Submit, the file cannot be successfully submitted to the SAE cloud server. Need to pass Sae Provided by Storage Sotrage API interface uploads local files SAE Sto Rage Storage file to achieve this effect!!


The following is a step through the picture to explain:

1. Open our SAE application in service management here you can see storage


2. Then click Storage to go in and see the following screen

3. Click on the new domain name to start, this domain is used to store the future of our uploaded files, create a good after you can click on domain management to view our created domain

4. All have, now only owe us by writing procedures to this domain storage data, I use PHP language, other language principle is the same!

 FileExists ($domain, $filename) = = True) {//Determine if the file already exists echo "

Image already exists, please re-upload!

"; }else{$filename = $_files["File" ["name"]; $storage->upload ($domain, $filename, $_files[file][tmp_name]); echo "

Image upload Successful!

"; echo "";}}else{echo "

Incorrect number of pictures, upload failed!

"; }}?><title></title>

Look under: A little card everyone can put code to test their own machine on the run under



How do we access this through the program we store in domain Picture of that?

What's next is showimage.php

!--? php$sae_storage        = new Saestorage (); $domainName = "Kepuna"; $listArray = $sae _storage--->getlist ($domainName); foreach ($listArray as $image) {echo "";}? 


methods There are many more, I'm just one of them, you can refer to the

span> http://apidoc.sinaapp.com/class-SaeStorage.html The official documentation for the SAE everyone, it's easy!

Below are all the pictures in my domain

Copyright notice: This article is the original article of Bo Master , not reproduced without the permission of the blogger.

Above describes the sae-upload local images to the storagephp version of SAE, including aspects of the content, I hope to be interested in PHP tutorial friends helpful.

  • 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.