Php Image Upload storage source code and can be previewed

Source: Internet
Author: User
Tags imagecopy imagejpeg
Php pictures are uploaded to the storage source code and can be previewed. For more information about php learning, see.

Php pictures are uploaded to the storage source code and can be previewed. For more information about php learning, see.

The Code is as follows:
Header ("content-Type: text/html; charset = gb2312 ");
$ Uptypes = array ('image/jpg ', // list of uploaded file types
'Image/jpeg ',
'Image/png ',
'Image/pjpeg ',
'Image/gif ',
'Image/bmp ',
'Application/x-shockwave-flash ',
'Image/x-png ',
'Application/msword ',
'Audio/x-ms-wm ',
'Audio/mp3 ',
'Application/vnd. rn-realmedia ',
'Application/x-zip-compressed ',
'Application/octet-stream ');
$ Max_file_size = 10000000; // size limit of uploaded files, in bytes
$ Path_parts = pathinfo ($ _ SERVER ['php _ SELF ']); // obtain the current path
$ Destination_folder = "up/"; // File Upload path
$ Watermark = 0; // whether to add a watermark. (1 indicates adding a watermark, and 0 indicates not adding a watermark );
$ Watertype = 1; // watermark type (1 is text, 2 is image)
$ Waterposition = 2; // watermark position (1 indicates the lower left corner, 2 indicates the lower right corner, 3 indicates the upper left corner, 4 indicates the upper right corner, and 5 indicates the center );
$ Waterstring = "www. yinao. tk"; // watermark string
$ Waterimg = "xplore.gif"; // watermark image
$ Imgpreview = 1; // whether to generate a preview image (1 is generated, 0 is not generated );
$ Imgpreviewsize = 1/1; // thumbnail Ratio
?>


Image Upload and storage






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.