<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic HTTP Utility Multipart in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/HTTP-Utility-Multipart/m-p/96591#M44806</link>
    <description>Hello Everyone,&lt;BR /&gt;&lt;BR /&gt;I am using HTTP Utility Multipart VBO, to upload file to Web API(form-data). I am able to upload file, but file turns out to be blank after uploading . Iam passing Headers, URL and FileMetaData(filepath).Kindly , let me understand why the content is missing in the uploaded file.</description>
    <pubDate>Thu, 29 Apr 2021 12:44:19 GMT</pubDate>
    <dc:creator>SireeshaJaggems</dc:creator>
    <dc:date>2021-04-29T12:44:19Z</dc:date>
    <item>
      <title>HTTP Utility Multipart</title>
      <link>https://community.blueprism.com/t5/Product-Forum/HTTP-Utility-Multipart/m-p/96591#M44806</link>
      <description>Hello Everyone,&lt;BR /&gt;&lt;BR /&gt;I am using HTTP Utility Multipart VBO, to upload file to Web API(form-data). I am able to upload file, but file turns out to be blank after uploading . Iam passing Headers, URL and FileMetaData(filepath).Kindly , let me understand why the content is missing in the uploaded file.</description>
      <pubDate>Thu, 29 Apr 2021 12:44:19 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/HTTP-Utility-Multipart/m-p/96591#M44806</guid>
      <dc:creator>SireeshaJaggems</dc:creator>
      <dc:date>2021-04-29T12:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Utility Multipart</title>
      <link>https://community.blueprism.com/t5/Product-Forum/HTTP-Utility-Multipart/m-p/96592#M44807</link>
      <description>Hi &lt;A class="author" href="https://community.blueprism.com/network/profile?UserKey=7ed31d00-83ea-4217-9e10-879b3e9b635c" target="_blank" rel="noopener"&gt;Sireesha&lt;/A&gt;,&lt;BR /&gt;&lt;BR /&gt;What is the response status that you get? Is it 200/201? Also have you already tried the same HTTP request from POSTMAN? Would you be able to share details on the request parameters and the API being used or any API documentation for the API that you are calling.</description>
      <pubDate>Thu, 06 May 2021 11:44:32 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/HTTP-Utility-Multipart/m-p/96592#M44807</guid>
      <dc:creator>shashank.kumar280</dc:creator>
      <dc:date>2021-05-06T11:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Utility Multipart</title>
      <link>https://community.blueprism.com/t5/Product-Forum/HTTP-Utility-Multipart/m-p/96593#M44808</link>
      <description>&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/46218"&gt;@SireeshaJaggems&lt;/a&gt; : Even I have the same query(File is getting corrupted post uploading into application) too. Can you please share your solution if it is already resolved.​​&lt;BR /&gt;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/1537"&gt;@shashank.kumar280&lt;/a&gt; : Yes it is working fine in Postman for my solution. The status is 200 in Postman&lt;BR /&gt;.&lt;BR /&gt;Postman Details :&lt;BR /&gt;&lt;BR /&gt;Accept: */*&lt;BR /&gt;Cache-Control: no-cache&lt;BR /&gt;Postman-Token: 4b24317d-edef-4ca5-bf97-c3767434b1,70ace7f6-f3dc-4876-ade9-c46de5b54fed&lt;BR /&gt;cookie: JSESSIONID=0000IypvyfzKGyD9J5oRV5R:1chgff5g&lt;BR /&gt;accept-encoding: gzip, deflate&lt;BR /&gt;content-type: multipart/form-data; boundary=--------------------------249786833778856564545&lt;BR /&gt;content-length: 260868&lt;BR /&gt;Connection: keep-alive&lt;BR /&gt;cache-control: no-cache&lt;BR /&gt;Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZo7WV&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Content-Disposition: form-data; name="uploadFile"; filename="/C:/Users/45078310/Desktop/1076595308.pdf&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;------WebKitFormBoundary7MA4YWxkTrZo7WV--&lt;BR /&gt;​​</description>
      <pubDate>Thu, 20 May 2021 06:01:24 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/HTTP-Utility-Multipart/m-p/96593#M44808</guid>
      <dc:creator>PragatiPatnaik</dc:creator>
      <dc:date>2021-05-20T06:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Utility Multipart</title>
      <link>https://community.blueprism.com/t5/Product-Forum/HTTP-Utility-Multipart/m-p/96594#M44809</link>
      <description>&lt;A class="user-content-mention" data-sign="@" data-contactkey="c00a4bb3-453e-484f-a177-07db2deb5036" data-tag-text="@Pragati Patnaik" href="https://community.blueprism.com/network/profile?UserKey=c00a4bb3-453e-484f-a177-07db2deb5036" data-itemmentionkey="6754eac9-bc60-4dd7-b8f4-69bf31e96c96"&gt;@Pragati Patnaik&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I couldn't&amp;nbsp; find the resolution for the issue with the http VBO, so I developed below C# code to upload the files.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;status = null;&lt;BR /&gt;string url = URL;&amp;nbsp; // web api url&lt;BR /&gt;string file = FilePath; // path of file to upload&lt;BR /&gt;string paramName = "file";&lt;BR /&gt;// string contentType = "text/plain";&lt;BR /&gt;&lt;BR /&gt;string username = null;&lt;BR /&gt;string password = null;&lt;BR /&gt;string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x");&lt;BR /&gt;byte[] boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");&lt;BR /&gt;&lt;BR /&gt;HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(url);&lt;BR /&gt;&lt;BR /&gt;foreach (DataRow r in headers.Rows)&lt;BR /&gt;{&lt;BR /&gt;foreach (DataColumn c in headers.Columns)&lt;BR /&gt;{&lt;BR /&gt;string columnName = c.ColumnName;&lt;BR /&gt;string val = (r[columnName]).ToString();&lt;BR /&gt;wr.Headers.Add(columnName, val);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;wr.Headers.Add("Authorization", "Basic");&lt;BR /&gt;wr.ContentType = "multipart/form-data; boundary=" + boundary;&lt;BR /&gt;wr.Method = "POST";&lt;BR /&gt;wr.KeepAlive = true;&lt;BR /&gt;&lt;BR /&gt;Stream rs = wr.GetRequestStream();&lt;BR /&gt;&lt;BR /&gt;string formdataTemplate = "Content-Disposition: form-data; name=\"{0}\"\r\n\r\n{1}";&lt;BR /&gt;&lt;BR /&gt;rs.Write(boundarybytes, 0, boundarybytes.Length);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;string headerTemplate = "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"\r\nContent-Type: {2}\r\n\r\n";&lt;BR /&gt;&lt;BR /&gt;// var mimeType = MimeMapping.GetMimeMapping(file);&lt;BR /&gt;// contentType = MimeMapping.MimeUtility.GetMimeMapping(file);&lt;BR /&gt;// string mimeType = System.Web.MimeMapping.GetMimeMapping(file);&lt;BR /&gt;&lt;BR /&gt;string filename = Path.GetFileName(file);&lt;BR /&gt;//contentType=MimeMapping.GetMimeMapping(filename);&lt;BR /&gt;string header = string.Format(headerTemplate, paramName, filename, contentType);&lt;BR /&gt;byte[] headerbytes = System.Text.Encoding.UTF8.GetBytes(header);&lt;BR /&gt;rs.Write(headerbytes, 0, headerbytes.Length);&lt;BR /&gt;&lt;BR /&gt;FileStream fileStream = new FileStream(file, FileMode.Open, FileAccess.Read);&lt;BR /&gt;byte[] buffer = new byte[4096];&lt;BR /&gt;int bytesRead = 0;&lt;BR /&gt;while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) != 0)&lt;BR /&gt;{&lt;BR /&gt;rs.Write(buffer, 0, bytesRead);&lt;BR /&gt;}&lt;BR /&gt;fileStream.Close();&lt;BR /&gt;&lt;BR /&gt;byte[] trailer = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "--\r\n");&lt;BR /&gt;rs.Write(trailer, 0, trailer.Length);&lt;BR /&gt;rs.Close();&lt;BR /&gt;&lt;BR /&gt;WebResponse wresp = null;&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;wresp = wr.GetResponse();&lt;BR /&gt;Stream stream2 = wresp.GetResponseStream();&lt;BR /&gt;StreamReader reader2 = new StreamReader(stream2);&lt;BR /&gt;status = "success";&lt;BR /&gt;//log.Debug(string.Format("File uploaded, server response is: {0}", reader2.ReadToEnd()));&lt;BR /&gt;}&lt;BR /&gt;catch (WebException ex)&lt;BR /&gt;{&lt;BR /&gt;using (var stream = ex.Response.GetResponseStream())&lt;BR /&gt;using (var reader = new StreamReader(stream))&lt;BR /&gt;{&lt;BR /&gt;status = reader.ReadToEnd();&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if (wresp != null)&lt;BR /&gt;{&lt;BR /&gt;wresp.Close();&lt;BR /&gt;wresp = null;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;finally&lt;BR /&gt;{&lt;BR /&gt;wr = null;&lt;BR /&gt;} &lt;BR /&gt;​&lt;BR /&gt;Hope this helps​.​</description>
      <pubDate>Thu, 20 May 2021 06:32:37 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/HTTP-Utility-Multipart/m-p/96594#M44809</guid>
      <dc:creator>SireeshaJaggems</dc:creator>
      <dc:date>2021-05-20T06:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Utility Multipart</title>
      <link>https://community.blueprism.com/t5/Product-Forum/HTTP-Utility-Multipart/m-p/96595#M44810</link>
      <description>&lt;A class="user-content-mention" data-sign="@" data-contactkey="c00a4bb3-453e-484f-a177-07db2deb5036" data-tag-text="@Pragati Patnaik" href="https://community.blueprism.com/network/profile?UserKey=c00a4bb3-453e-484f-a177-07db2deb5036" data-itemmentionkey="9b77a282-f46f-48a1-aaa1-c5c5b35cf7dd"&gt;@Pragati Patnaik&lt;/A&gt; Could you confirm what parameters were passed in FileMetadata collection and FieldMetadata collection?​</description>
      <pubDate>Thu, 20 May 2021 07:00:41 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/HTTP-Utility-Multipart/m-p/96595#M44810</guid>
      <dc:creator>shashank.kumar280</dc:creator>
      <dc:date>2021-05-20T07:00:41Z</dc:date>
    </item>
  </channel>
</rss>

