<?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: Adding attachment with long name causes size to be zero. in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/adding-attachment-with-long-name-causes-size-to-be/m-p/343197#M4029</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This issue was fixed in v100.6 of ArcGIS Runtime SDK for .NET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Sep 2019 17:13:20 GMT</pubDate>
    <dc:creator>MichaelBranscomb</dc:creator>
    <dc:date>2019-09-13T17:13:20Z</dc:date>
    <item>
      <title>Adding attachment with long name causes size to be zero.</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/adding-attachment-with-long-name-causes-size-to-be/m-p/343195#M4027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using version 100.4 of the ArcGIS .NET runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have noticed that&amp;nbsp;attachments with names longer than 40 characters (not including the file extension) will always have a size of zero when returned from&amp;nbsp;ArcGISFeature.GetAttachmentAsync(). Note: An attachment name longer than 40 characters appears to be truncated to 40 characters. Here is an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;// Name is truncated to&amp;nbsp;"Google Play Distribution Agreement (SP C.pdf"
await&amp;nbsp;myFeature.AddAttachmentAsync("Google Play Distribution Agreement (SP Comments).pdf", "application/pdf",&amp;nbsp;&amp;lt;attachmentData&amp;gt;);

await myFeature.FeatureTable.UpdateFeatureAsync(myFeature);
if&amp;nbsp;(myFeature.FeatureTable&amp;nbsp;is&amp;nbsp;ServiceFeatureTable&amp;nbsp;serviceFeatureTable)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var&amp;nbsp;editResults&amp;nbsp;=&amp;nbsp;await&amp;nbsp;serviceFeatureTable.ApplyEditsAsync();
      var&amp;nbsp;featureResult&amp;nbsp;=&amp;nbsp;(FeatureEditResult)editResults.FirstOrDefault();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var&amp;nbsp;attachmentResult&amp;nbsp;=&amp;nbsp;featureResult.AttachmentResults.First(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
      var&amp;nbsp;id =&amp;nbsp;attachmentResult.ObjectId;
      var&amp;nbsp;allAttachments&amp;nbsp;=&amp;nbsp;await&amp;nbsp;myFeature.GetAttachmentsAsync();

      // This will have a size of 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;myAttachment =&amp;nbsp;allAttachments.FirstOrDefault(a&amp;nbsp;=&amp;gt;&amp;nbsp;a.Id&amp;nbsp;==&amp;nbsp;id);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
}
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you rename the same file to have name shorter than 40 characters, the size will be set correctly. I have attached the offending file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This only occurs after the attachment was added to the feature. If the attachment already exists on myFeature then GetAttachmentsAsync() returns the attachments with correct sizes. The attachment returned from AddAttachmentAsync() has the correct size, but of course does not have the correct id yet. I managed to work around this by doing something like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;var data = await attachment.GetDataAsync(); 
var size = data.Length;‍‍&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:11:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/adding-attachment-with-long-name-causes-size-to-be/m-p/343195#M4027</guid>
      <dc:creator>deleted-user-7asiru_Gs_LV</dc:creator>
      <dc:date>2021-12-11T16:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Adding attachment with long name causes size to be zero.</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/adding-attachment-with-long-name-causes-size-to-be/m-p/343196#M4028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jeff,&lt;/P&gt;&lt;P&gt;Thanks for notifying about&amp;nbsp;size for attachments with filenames greater than 40 characters. I am able to repro the problem and have logged a bug to address in&amp;nbsp;future release. I am glad at least you have a workaround.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, thanks for bringing this to out attention. Let me know if you have any further questions on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Preeti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2019 18:57:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/adding-attachment-with-long-name-causes-size-to-be/m-p/343196#M4028</guid>
      <dc:creator>PreetiMaske</dc:creator>
      <dc:date>2019-01-24T18:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Adding attachment with long name causes size to be zero.</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/adding-attachment-with-long-name-causes-size-to-be/m-p/343197#M4029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This issue was fixed in v100.6 of ArcGIS Runtime SDK for .NET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 17:13:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/adding-attachment-with-long-name-causes-size-to-be/m-p/343197#M4029</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2019-09-13T17:13:20Z</dc:date>
    </item>
  </channel>
</rss>

