Sina Cloud implementation upload thumbnail image

Source: Internet
Author: User
Tags imagejpeg

<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/> Ob_start (); Imagejpeg ($temp _img); $imgstr = Ob_get_contents (); $s->write (' image1234 ', $savepath, $IMGSTR); Ob_end_clean (); Imagedestroy ($im);   Return "saestor://image1234/". $savepath; }
function Create_guid () {
$charid = Strtoupper (MD5 (Uniqid (Mt_rand (), true));
$hyphen = Chr (45);//"-"

substr ($charid, 0, 8)
. substr ($charid, 8, 4)
. substr ($charid, 12, 4)
. substr ($charid, 16, 4)
;
return $uuid;
}
if ($_server[' request_method ' = = ' POST ')  {      echo "\ n upload start time:". ". Date (' y-m-d h:i:s '; time ())." \ n ";    $destination _folder= "saestor://image1234/updateimg/"; Upload file path need to create storage on Sina cloud    $file = $_files["Upfile"];      $filename = $file ["Tmp_name"];      $image _size = getimagesize ($filename);      $pinfo =pathinfo ($file ["name"]);      $ftype = $pinfo [' extension '];      $imagebig =create_guid (). ".". $ftype;    $imagesmall =create_guid (). ".". $ftype;    $bucket = "w376161501";    $object = "ionic/imagebig/". $imagebig; try{
if (Move_uploaded_file ($filename, $destination _folder. $imagebig))//parameter is the location and name of the file stream and storage
{
echo "Original image upload success";
}
    $path =outputsmallimage ($filename, 225, $imagesmall);      } catch (Ossexception $e) {    echo $e;    }     Unlink ($path); Used to delete thumbnails}?></body>  

* Sina Cloud on imagegif does not support wrapper, namely Imageif,imagejpeg,imagepan not adapt. Write to Buffer Ob_start () and write to Stor by Saestorage

* Need to apply for storage (free) on Sina Cloud

Another way to refer to Links: http://blog.csdn.net/yangyun_1999/article/details/20377989#comments

Other Sina cloud application files Read and write: http://blog.csdn.net/liuqiyao_01/article/details/8551274 (reference value is relatively large)

Sina Cloud implementation upload thumbnail image

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.