Where is the uploaded image saved?

Source: Internet
Author: User
Tags imagecopy imagejpeg unsupported
I will not upload images. I found the following code on the Internet and found an image on my machine. I can upload the image successfully. I checked that there is an uploadimg folder under my www directory. if this image has just been uploaded successfully, the image has been successfully uploaded and saved in this image all the time... I will not upload images. I found the following code on the Internet and found an image on my machine. I can upload the image successfully. I checked that there is an uploadimg folder under my www directory. if this image has just been uploaded successfully, has it been uploaded successfully? Is this image always saved here? The effect I want is to upload the image to a page and you will see it every time I open this page. what should I do with this image?


  ;    ZwelL Image Upload Program        
        
  File Name: ". $ destination_folder. $ fname ."
"; Echo" width: ". $ image_size [0]; echo" Length: ". $ image_size [1]; echo"
Size :". $ file ["size"]. "bytes"; if ($ watermark = 1) {$ iinfo = getimagesize ($ destination, $ iinfo); $ nimage = imagecreatetruecolor ($ image_size [0], $ image_size [1]); $ white = imagecolorallocate ($ nimage, 255,255,255); $ black = imagecolorallocate ($ nimage, 0, 0); $ red = imagecolorallocate ($ nimage,, 0, 0); imagefill ($ nimage, $ white); switch ($ iinfo [2]) {case 1: $ simage = imagecreatefromgif ($ destination); break; case 2: $ simage = imagecreatefromjpeg ($ destination); break; case 3: $ simage = imagecreatefrompng ($ destination); break; case 6: $ simage = imagecreatefromwbmp ($ destination ); break; default: die ("unsupported file types"); exit;} imagecopy ($ nimage, $ simage, 0, 0, 0, $ image_size [0], $ image_size [1]); imagefilledrectangle ($ nimage, 1, $ image_size [1]-15, 80, $ image_size [1], $ white); switch ($ watertype) {case 1: // Add the watermark string imagestring ($ nimage, 2, 3, $ image_size [1]-15, $ waterstring, $ black); break; case 2: // watermark image $ simage1 = imagecreatefromgif ("xplore.gif"); imagecopy ($ nimage, $ simage1,); imagedestroy ($ simage1); break ;} switch ($ iinfo [2]) {case 1: // imagegif ($ nimage, $ destination); imagejpeg ($ nimage, $ destination); break; case 2: imagejpeg ($ nimage, $ destination); break; case 3: imagepng ($ nimage, $ destination); break; case 6: imagewbmp ($ nimage, $ destination ); // imagejpeg ($ nimage, $ destination); break;} // overwrite the original uploaded file imagedestroy ($ nimage); imagedestroy ($ simage );} if ($ imgpreview = 1) {echo"
Image preview:
"; Echo" ";}}?>

Reply content:

I will not upload images. I found the following code on the Internet and found an image on my machine. I can upload the image successfully. I checked that there is an uploadimg folder under my www directory. if this image has just been uploaded successfully, has it been uploaded successfully? Is this image always saved here? The effect I want is to upload the image to a page and you will see it every time I open this page. what should I do with this image?


  ;    ZwelL Image Upload Program        
        
  File Name: ". $ destination_folder. $ fname ."
"; Echo" width: ". $ image_size [0]; echo" Length: ". $ image_size [1]; echo"
Size :". $ file ["size"]. "bytes"; if ($ watermark = 1) {$ iinfo = getimagesize ($ destination, $ iinfo); $ nimage = imagecreatetruecolor ($ image_size [0], $ image_size [1]); $ white = imagecolorallocate ($ nimage, 255,255,255); $ black = imagecolorallocate ($ nimage, 0, 0); $ red = imagecolorallocate ($ nimage,, 0, 0); imagefill ($ nimage, $ white); switch ($ iinfo [2]) {case 1: $ simage = imagecreatefromgif ($ destination); break; case 2: $ simage = imagecreatefromjpeg ($ destination); break; case 3: $ simage = imagecreatefrompng ($ destination); break; case 6: $ simage = imagecreatefromwbmp ($ destination ); break; default: die ("unsupported file types"); exit;} imagecopy ($ nimage, $ simage, 0, 0, 0, $ image_size [0], $ image_size [1]); imagefilledrectangle ($ nimage, 1, $ image_size [1]-15, 80, $ image_size [1], $ white); switch ($ watertype) {case 1: // Add the watermark string imagestring ($ nimage, 2, 3, $ image_size [1]-15, $ waterstring, $ black); break; case 2: // watermark image $ simage1 = imagecreatefromgif ("xplore.gif"); imagecopy ($ nimage, $ simage1,); imagedestroy ($ simage1); break ;} switch ($ iinfo [2]) {case 1: // imagegif ($ nimage, $ destination); imagejpeg ($ nimage, $ destination); break; case 2: imagejpeg ($ nimage, $ destination); break; case 3: imagepng ($ nimage, $ destination); break; case 6: imagewbmp ($ nimage, $ destination ); // imagejpeg ($ nimage, $ destination); break;} // overwrite the original uploaded file imagedestroy ($ nimage); imagedestroy ($ simage );} if ($ imgpreview = 1) {echo"
Image preview:
"; Echo" ";}}?>

Upload images to the server... Reference the relative address of the server image on the page...

This is relatively basic

The upstairs is right. Just reference the relative path of this image on the server. The server is case sensitive.

Upstairs is correct.

At the end of the server, use $ _ FILES to view the file information.
If empty ($ _ FILES) is true, no FILES exist. Otherwise, the FILES are successfully uploaded. Dump.

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.