<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>File upload validation</title><link>https://community.appian.com/discussions/f/user-interface/11940/file-upload-validation</link><description>I&amp;#39;m using the following code to validate a user uploaded file : 
 
 a!gridRowLayout( id: ri!index, contents: { if( ri!index &amp;gt; ri!oldAttachments, a!fileUploadField_17r1( label: &amp;quot;file upload &amp;quot; &amp;amp; ri!index, target: ri!target, value: ri!attachments[ri!index</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/115949?ContentTypeID=1</link><pubDate>Mon, 10 Jul 2023 17:50:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:536459db-86b2-4e36-bfec-ead0f9033d9a</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;For future reference, the links are usually unchanged but you just have to point to the correct version. If you find a really old post like this, just change the version number (17.4 in the link above) to a more recent version (e.g. 23.2) and it should work!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/115902?ContentTypeID=1</link><pubDate>Mon, 10 Jul 2023 09:40:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4ac43cbb-7ab9-4e12-a9b0-a4feb9e5c32e</guid><dc:creator>gayatria0439</dc:creator><description>&lt;p&gt;Thank you @Mathieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/115901?ContentTypeID=1</link><pubDate>Mon, 10 Jul 2023 09:38:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bc295513-bc04-4c8f-877c-9babc3b61536</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/23.2/File_Upload_Component.html"&gt;docs.appian.com/.../File_Upload_Component.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/115899?ContentTypeID=1</link><pubDate>Mon, 10 Jul 2023 09:34:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:90129f88-a893-4dd0-b0c0-81f84aa0333d</guid><dc:creator>gayatria0439</dc:creator><description>&lt;p&gt;HI Eliot Gerson, Hope you are doing good. my question is nearer to your solution but am unable to open the docs you have shared can you share it again if possible. Thanks in advance&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/105069?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2022 07:25:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f035437e-07cb-44ea-9255-7da1e6f314bd</guid><dc:creator>Sangili Muniarasan</dc:creator><description>&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/22.4/File_Upload_Component.html#all-files-must-be-pdfs"&gt;https://docs.appian.com/suite/help/22.4/File_Upload_Component.html#all-files-must-be-pdfs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;this will help for file upload validation&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/105068?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2022 07:16:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ed1db5b6-d6c7-44ff-ad2e-8f36eddd1e4c</guid><dc:creator>Sangili Muniarasan</dc:creator><description>&lt;p&gt;ok got it&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/105040?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2022 13:15:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a6609e4c-96ff-47b0-a24c-9a514ef3c4d3</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="114592" url="~/discussions/f/user-interface/11940/file-upload-validation/105038#105038"]it is not giving expected output[/quote]
&lt;p&gt;That&amp;#39;s not very much info to go on, especially since this post is nearly 5 years old...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/105038?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2022 12:48:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:54b9f752-59a7-4b69-b819-7471bf923b83</guid><dc:creator>Sangili Muniarasan</dc:creator><description>&lt;p&gt;it is not giving expected output&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/52938?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2018 04:42:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2421fcdb-0a6a-4adf-acb7-bfc3adf28351</guid><dc:creator>apoorvam</dc:creator><description>I understand. The version currently being used is 17.3&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/52916?ContentTypeID=1</link><pubDate>Sun, 25 Feb 2018 16:38:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5a5788a3-6bdd-43eb-9ef5-ff3bbe215c84</guid><dc:creator>Ranveer</dc:creator><description>Will you please tell me which version of Appian you are using. Its differ from version to version. This is not the correct way of using and Appian have not mentioned this approach so they use to change background functionality of components. So if you tell me your Appian Version I can give you proper code for a!fileUploadField_17r1(). In future you may also face same issue if Appian update the back end functionality.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/52915?ContentTypeID=1</link><pubDate>Sun, 25 Feb 2018 16:32:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4d0689c8-cf1f-4000-a73a-4e671c95170f</guid><dc:creator>apoorvam</dc:creator><description>Thank you, but using fileUploadFile() with my current code is giving me a lot of major errors. Is there some way to validate uploaded files using a!fileUploadField_17r1() ?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/52909?ContentTypeID=1</link><pubDate>Fri, 23 Feb 2018 19:01:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2226e386-4b2d-481e-ad04-1cc5b8e704d5</guid><dc:creator>Ranveer</dc:creator><description>The current version of Appian can give direct validations below:&lt;br /&gt;
a!fileUploadField(&lt;br /&gt;
    label: &amp;quot;File Upload&amp;quot;,&lt;br /&gt;
    value: ri!document,&lt;br /&gt;
    saveInto: {&lt;br /&gt;
      ri!document&lt;br /&gt;
    },&lt;br /&gt;
    validations: if(&lt;br /&gt;
      contains({&amp;quot;JPG&amp;quot;, &amp;quot;JPEG&amp;quot;, &amp;quot;BMP&amp;quot;, &amp;quot;PNG&amp;quot;, &amp;quot;ICO&amp;quot;, &amp;quot;GIF&amp;quot;, &amp;quot;jpeg&amp;quot;}, fv!files.extension),&lt;br /&gt;
      &amp;quot;&amp;quot;,&lt;br /&gt;
      &amp;quot;Invalid Format&amp;quot;&lt;br /&gt;
    )&lt;br /&gt;
  )&lt;br /&gt;
&lt;br /&gt;
Make sure the extension is case sensitive.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/52857?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2018 08:05:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7970099a-8db4-4d69-b18b-2605da2fd25a</guid><dc:creator>apoorvam</dc:creator><description>Thank you.. &lt;br /&gt;
 Currently, there is no error message as I have used &amp;quot;a!fileUploadField&amp;quot; instead of &amp;quot;a!fileUploadField_17r1&amp;quot; and the validations are valid ,  but now each &amp;quot;upload file&amp;quot; segment occupies two rows in the attachments grid on the dashboard and both the occupied rows both contain the &amp;quot;+&amp;quot; sign to add files, but when I try to add files in the 2nd row after adding in the 1st row, they are not uploaded in the 2nd row. Apologies, Its a little difficult to explain&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/52856?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2018 08:05:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:31bbb85f-759f-4599-9ce9-e23261a0d487</guid><dc:creator>apoorvam</dc:creator><description>The piece of code named &amp;quot;AttachmentsGridRow&amp;quot; is called in a!applyComponents within a!gridLayout as follows: &lt;br /&gt;
&lt;br /&gt;
a!gridLayout(&lt;br /&gt;
&lt;br /&gt;
        instructions: &amp;quot;Accepted Formats: docsx, xlsx, pdf&amp;quot;,&lt;br /&gt;
        label: &amp;quot;Attachments&amp;quot;,&lt;br /&gt;
        emptyGridMessage: &amp;quot;No files have been attached to this record&amp;quot;,&lt;br /&gt;
        headerCells: {&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;File&amp;quot;),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Uploaded On&amp;quot;, align: &amp;quot;RIGHT&amp;quot;),&lt;br /&gt;
          if(&lt;br /&gt;
            ri!readOnly,&lt;br /&gt;
            {},&lt;br /&gt;
            a!gridLayoutHeaderCell()&lt;br /&gt;
          )&lt;br /&gt;
        },&lt;br /&gt;
        columnConfigs: {&lt;br /&gt;
          a!gridLayoutColumnConfig(weight: 7),&lt;br /&gt;
          a!gridLayoutColumnConfig(weight: 3),&lt;br /&gt;
          if(&lt;br /&gt;
            ri!readOnly,&lt;br /&gt;
            {},&lt;br /&gt;
            a!gridLayoutColumnConfig(width: &amp;quot;ICON&amp;quot;)&lt;br /&gt;
          )&lt;br /&gt;
        },&lt;br /&gt;
        rows: a!applyComponents(&lt;br /&gt;
          function: rule!AttachmentsGridRow(&lt;br /&gt;
            &lt;br /&gt;
            attachments: ri!documents,&lt;br /&gt;
            deletedAttachments: ri!deletedDocuments,&lt;br /&gt;
            index: _,&lt;br /&gt;
            readOnly: ri!readOnly,&lt;br /&gt;
            oldAttachments: local!oldAttachments,&lt;br /&gt;
            target: ri!target&lt;br /&gt;
          ),&lt;br /&gt;
          array: if(&lt;br /&gt;
            or(isnull(ri!documents), count(ri!documents) &amp;lt; 1),&lt;br /&gt;
            {},&lt;br /&gt;
            1+enumerate(count(ri!documents))&lt;br /&gt;
          )&lt;br /&gt;
          &lt;br /&gt;
        ),&lt;br /&gt;
        addRowLink: if(&lt;br /&gt;
          ri!readOnly,&lt;br /&gt;
          null,&lt;br /&gt;
          a!dynamicLink(&lt;br /&gt;
            label: &amp;quot;Attach New File&amp;quot;,&lt;br /&gt;
            value: todocument(null),&lt;br /&gt;
            saveInto: a!save(ri!documents, append(ri!documents, save!value))&lt;br /&gt;
          )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
currently, there is no error message as I have used &amp;quot;a!fileUploadField&amp;quot; instead of &amp;quot;a!fileUploadField_17r1&amp;quot; and the validations are valid ,  but now each &amp;quot;upload file&amp;quot; segment occupies two rows in the attachments grid on the dashboard and both the occupied rows both contain the &amp;quot;+&amp;quot; sign to add files, but when I try to add files in the 2nd row after adding in the 1st row, they are not uploaded in the 2nd row. Apologies, Its a little difficult to explain&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/52835?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2018 19:01:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f085c03a-f242-411c-a17c-fa6c13ae1c83</guid><dc:creator>Ravi Roshan</dc:creator><description>Can you please share the portion where you are calling this peace of code inside the foreach() function, and please also share the error message.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File upload validation</title><link>https://community.appian.com/thread/52828?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2018 14:41:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fd863705-8877-437b-b5a2-50b4d51813d9</guid><dc:creator>Eliot Gerson</dc:creator><description>Is there a reason you&amp;#39;re opting to use a!fileUploadField_17r1 , rather than a!fileUploadField?  &lt;br /&gt;
&lt;br /&gt;
I would suggest using a!fileUploadField and using the examples in the documentation as a starting point for validating file extensions. &lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://docs.appian.com/suite/help/17.4/File_Upload_Component.html"&gt;docs.appian.com/.../File_Upload_Component.html&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>