1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice

How do you Post Multiple Images via HTTP

Discussion in 'C, C++, C#' started by koolmelee, Jan 23, 2010.

  1. koolmelee

    koolmelee Newbie

    Aug 11, 2009
    Likes Received:
    I am trying to implement the Decaptcher.com HTTP API in C#. I have the normal Decaptcher HTTP request correct, but I cannot get the Assira(Cat Captcha) HTTP request to work. This requires POSTing 12 images to a url with multipart/form-data.

    I have tried many many different ways of posting the data...but I keep getting a blank response from Decaptcher.

    According to Decaptchers website, the HTML form should look like this:
     <input type="hidden" name="function" value="picture2">
     <input type="text"   name="username" value="client">
     <input type="text"   name="password" value="qwerty">
     <input type="file"   name="pict1">
     <input type="file"   name="pict2">
     <input type="file"   name="pict3">
     <input type="file"   name="pict4">
     <input type="file"   name="pict5">
     <input type="file"   name="pict6">
     <input type="file"   name="pict7">
     <input type="file"   name="pict8">
     <input type="file"   name="pict9">
     <input type="file"   name="pict10">
     <input type="file"   name="pict11">
     <input type="file"   name="pict12">
     <input type="text"   name="pict_to"   value="0">
     <input type="text"   name="pict_type" value="86">
     <input type="submit" value="Send">
    Now how do I translate that into a HTTP request?? Keep in mind I do have their normal Decaptcher service working via HTTP requests, but I just don't know how to post multiple files and google doesnt seem to help me =\

    I am using HTTPWebRequest class in .net C#.

    Please help!!
  2. mgaft1

    mgaft1 Newbie

    Oct 12, 2008
    Likes Received:
    I would use their C# interface API. If you download it, you'll see that for each decaptcha you need two initialization calls, login call and then picture recognition call. After that you can either close the session. If you want to recognize more images within the same session, you just need to repeat the picture recognition call as many times as you need.