SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2010
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP multiple image uploads problem

    I am trying to upload 4 images from a form using code below. All images upload and output fine apart from the last one which always has added code at the end of the image for example, image4.jpg%3E. As you can see the %3E is always being added.. not sure why..? any ideas?

    PHP Code:
    $product_image=$_FILES['product_image'];
            
            
            
    $product_image2 $_FILES['product_image2'];
            
            
    $product_image3 $_FILES['product_image3'];
            
            
    $product_image4 $_FILES['img_product_now'];



            if (
    is_uploaded_file($product_image['tmp_name'])&& ($product_image2['tmp_name'])){



                
    $filename=$product_id;
                
                
    $filename2=$product_id.'_2';

                
    $images uploadPImage($product_image$imgpath$filename);
                
                
    $images2 uploadProductImage($product_image2$imgpath$filename2);

                

            }

            if (
    is_uploaded_file($product_image4['tmp_name'])&& ($product_image4['tmp_name'])){


                
    $filename3 $product_id.'_3';
                
                
    $filename4 $product_id.'_4';
                
                
    $data uploadPImage ($product_image3$imgpath$filename3);
                
                
    $data2 uploadPImage ($product_image4$imgpath$filename4);
                

            } 

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by condo123 View Post
    As you can see
    No I can't see

    Try adding some var_dumps/echoes to check the values of your variables, maybe you'll see where that %3E comes from.

    And I don't understand your IF's? Don't you want to check is_uploaded_file for images 1 and 2 in the first IF, and for images 3 and 4 in the second IF ?

  3. #3
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    73 Post(s)
    Tagged
    0 Thread(s)
    Have you checked your form code to make sure you havent stuck an extra > in somewhere? (> being %3E in URLEncode)
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •