Php pictures are uploaded to the storage source code and can be previewed. For more information about php learning, see.
Copy codeThe 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
?>
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.