Sending FILE post data through PHP code

Discussion in 'Programming' started by goodmast3r, Nov 10, 2010.

  1. #1
    Is there a way to send FILE post data through PHP code.

    I found a code which send common POST data:

    fputs($fp, "POST $path HTTP/1.1\r\n");
    fputs($fp, "Host: $host\r\n");
    fputs($fp, "Referer: $referer\r\n");
    fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
    fputs($fp, "Content-length: ". strlen($data) ."\r\n");
    fputs($fp, "Connection: close\r\n\r\n");
    fputs($fp, $data);

    How do I send $_FILES data through POST. Is that posible?
     
    goodmast3r, Nov 10, 2010 IP
  2. gapz101

    gapz101 Well-Known Member

    Messages:
    524
    Likes Received:
    8
    Best Answers:
    2
    Trophy Points:
    150
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    possible, looks like this @/path/of/file
     
    gapz101, Nov 10, 2010 IP
  3. goodmast3r

    goodmast3r Active Member

    Messages:
    1,220
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    78
    As Seller:
    100% - 0
    As Buyer:
    100% - 6
    #3
    Could you please explain more about it gapz101?
     
    goodmast3r, Nov 10, 2010 IP