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