<?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 Re: Null Reference Exception in File Management Extended C# in Digital Exchange</title>
    <link>https://community.blueprism.com/t5/Digital-Exchange/Null-Reference-Exception-in-File-Management-Extended-C/m-p/100787#M3253</link>
    <description>Image is attached again.</description>
    <pubDate>Fri, 15 Apr 2022 08:24:53 GMT</pubDate>
    <dc:creator>BohyonHwang</dc:creator>
    <dc:date>2022-04-15T08:24:53Z</dc:date>
    <item>
      <title>Null Reference Exception in File Management Extended C#</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/Null-Reference-Exception-in-File-Management-Extended-C/m-p/100786#M3252</link>
      <description>&lt;DIV class="media" style="overflow: hidden"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="kh_placeholder.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/36562iDE7DF1A9584C4233/image-size/large?v=v2&amp;amp;px=999" role="button" title="kh_placeholder.png" alt="kh_placeholder.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
I'd tried to get an internet image file in the binary data item directly.&lt;BR /&gt;Utility - File Management [Extended C#] seemed to have the right action as 'Download File as Binary'.&lt;BR /&gt;But the action returned False Success even if HTTP Status Code equals 200 - OK.&lt;BR /&gt;&lt;BR /&gt;What's wrong with my code?&lt;BR /&gt;A screenshot is attached.&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Fri, 15 Apr 2022 08:11:53 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/Null-Reference-Exception-in-File-Management-Extended-C/m-p/100786#M3252</guid>
      <dc:creator>BohyonHwang</dc:creator>
      <dc:date>2022-04-15T08:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Null Reference Exception in File Management Extended C#</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/Null-Reference-Exception-in-File-Management-Extended-C/m-p/100787#M3253</link>
      <description>Image is attached again.</description>
      <pubDate>Fri, 15 Apr 2022 08:24:53 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/Null-Reference-Exception-in-File-Management-Extended-C/m-p/100787#M3253</guid>
      <dc:creator>BohyonHwang</dc:creator>
      <dc:date>2022-04-15T08:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Null Reference Exception in File Management Extended C#</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/Null-Reference-Exception-in-File-Management-Extended-C/m-p/100788#M3254</link>
      <description>Hi &lt;A class="user-content-mention" data-sign="@" data-contactkey="ae593f60-3873-45dd-921e-765652789fd8" data-tag-text="@Bohyon Hwang" href="https://community.blueprism.com/network/profile?UserKey=ae593f60-3873-45dd-921e-765652789fd8" data-itemmentionkey="f16c91d0-9369-46c0-9e90-882175833251"&gt;@Bohyon Hwang&lt;/A&gt;,&lt;BR /&gt;&lt;BR /&gt;Thank you for using Blue Prism. &lt;BR /&gt;&lt;BR /&gt;The problem seems to be that the code in the download elements is relying on a response header called Content-Disposition. Now, it seems that its null, hence the null exception you are getting when the process tries to retrieve the filename.&lt;BR /&gt;&lt;BR /&gt;Now, if you are familiar with C#, you could just edit the code as shown below:&lt;BR /&gt;&lt;BR /&gt;if (responseMessage.Content.Headers.ContentDisposition != null)
&lt;DIV&gt;{&lt;/DIV&gt;
&lt;DIV style="padding-left: 40px"&gt;fileName = responseMessage.Content.Headers.ContentDisposition.FileNameStar;&lt;/DIV&gt;
}&lt;BR /&gt;&lt;BR /&gt;This code can be found on the code page of the Download File As Binary action. The downside is that in this example the filename will not be returned. I will need to spend more time to see how this might be resolved in full. In the interim, I hope this helps.&lt;BR /&gt;&lt;BR /&gt;Once again, thank you for being an SS&amp;amp;C Blue Prism user.&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;&lt;BR /&gt;Geoff HIrst&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;SR DX Engineer, Integration and Enablement, Blue Prism Digital Exchange&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;-- Further Note. The problem may actually be that the website isn't responding how it should be. This link explains the header that is the issue here &lt;A href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition" target="test_blank"&gt;https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition&lt;/A&gt;. &lt;BR /&gt;&lt;BR /&gt;If you try to download from another site, do you get the same problem?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;BR /&gt;​</description>
      <pubDate>Thu, 12 May 2022 14:27:29 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/Null-Reference-Exception-in-File-Management-Extended-C/m-p/100788#M3254</guid>
      <dc:creator>GeoffHirst</dc:creator>
      <dc:date>2022-05-12T14:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Null Reference Exception in File Management Extended C#</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/Null-Reference-Exception-in-File-Management-Extended-C/m-p/100789#M3255</link>
      <description>The problem is solved with the help of Mr Geoff Hirst.&lt;BR /&gt;The data item can be filled with the correct data I wanted.&lt;BR /&gt;It also works for downloading another website.&lt;BR /&gt;Thank you so much.</description>
      <pubDate>Fri, 13 May 2022 02:07:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/Null-Reference-Exception-in-File-Management-Extended-C/m-p/100789#M3255</guid>
      <dc:creator>BohyonHwang</dc:creator>
      <dc:date>2022-05-13T02:07:00Z</dc:date>
    </item>
  </channel>
</rss>

