title: Prestashop - Upload image web service in c#
body: <p>I'm developing an app for a company. So, for the app they want to upload images to prestashop. The problem basically is that I can't manage to do it through web service. I always get an error 66:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;prestashop xmlns:xlink="http://www.w3.org/1999/xlink"&gt;
  &lt;errors&gt;
  &lt;error&gt;
  &lt;code&gt;
  &lt;![CDATA[66]]&gt;
  &lt;/code&gt;
  &lt;message&gt;
  &lt;![CDATA[Unable to save this image]]&gt;
  &lt;/message&gt;
  &lt;/error&gt;
  &lt;/errors&gt;
  &lt;/prestashop&gt;
  </code></pre>
  
  <p>I've tried everything (postman, httpclient, webclient). And the only thing that worked was the library of Prestasharp. HOWEVER, my boss doesn't want to rely on external libraries for the app. (yeah, I don't get it either). Hence, I was wondering if someone could tell me how to upload the image without the library.
  For example, the following code does not work, but I think it's right.</p>
  
  <pre><code>string file = @"C:\Users\MyPC\Pictures\Example\50.jpg";
  string webAddress = @"http://mywebsite.com/api/images/products/1?ws_key=NUZSHHQ1X456IJQDPXY3GUXG2C6AMAV3";
  
  var client = new HttpClient();
  
  var pairs = new List&lt;KeyValuePair&lt;string, string&gt;&gt;
  {
      new KeyValuePair&lt;string, string&gt;("image", file)
  };
  
  var content = new FormUrlEncodedContent(pairs);
  
  MessageBox.Show( client.PostAsync(webAddress, content).Result.ReasonPhrase );
  </code></pre>
  
  <p>I've seen people who complain about the same thing, but no one has ever solved this.</p>
  
  <p>I hope you guys can make it,</p>
  
  <p>Kindest regards</p>