<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/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>upload a  simple file to vault</title><link>https://www.aras.com/community/f/development/6654/upload-a-simple-file-to-vault</link><description>Hi everyone, 
 I try to make an app with aras.iom by C#. I want to upload a file to vault with code: 
 ... 
 Item item_File_thumb = this.inn.newItem(&amp;quot;File&amp;quot;, &amp;quot;add&amp;quot;); item_File_thumb.setProperty(&amp;quot;filename&amp;quot;, myFilename); item_File_thumb.attachPhysicalFile</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: upload a  simple file to vault</title><link>https://www.aras.com/community/thread/4214?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2020 13:12:13 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:12fb5c83-4258-4789-a355-340330feebca</guid><dc:creator>ashwinib</dc:creator><description>&lt;p&gt;Can You share how to get filepath&amp;nbsp; ? I am not getting exact one&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: upload a  simple file to vault</title><link>https://www.aras.com/community/thread/4194?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2020 10:39:31 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:3b284218-ea1e-49f4-b682-dc3c6cb278eb</guid><dc:creator>ashwinib</dc:creator><description>&lt;p&gt;Hii,&amp;nbsp; can You help me share ur code .I am using same code but getting error. below is the code in Aras-&lt;/p&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;using System.Data.HashFunction();&lt;br /&gt;//var inn = this.newInnovator();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;//HttpServerConnection conn = IomFactory.CreateHttpServerConnection(url, database, username, password);&lt;br /&gt;{&lt;br /&gt;HttpServerConnection conn = &lt;br /&gt;IomFactory.CreateHttpServerConnection(&amp;quot;&amp;quot;HDIVVI&amp;quot;,&amp;quot;innovator_regular&amp;quot;,&amp;quot;Admin@123&amp;quot;);&amp;quot;&amp;gt;localhost/.../Innovator.aspx&amp;quot;,&amp;quot;HDIVVI&amp;quot;,&amp;quot;innovator_regular&amp;quot;,&amp;quot;Admin@123&amp;quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;// Upload the file&lt;br /&gt;Innovator inn = new Innovator(conn);&lt;br /&gt;Item item_File_thumb = inn.newItem(&amp;quot;File&amp;quot;, &amp;quot;add&amp;quot;);&lt;br /&gt;item_File_thumb.setProperty(&amp;quot;filename&amp;quot;, myFilename);&lt;br /&gt;item_File_thumb.setProperty(&amp;quot;actual_filename&amp;quot;, myFilePath);&lt;br /&gt;item_File_thumb.setProperty(&amp;quot;checkedout_path&amp;quot;, myDir);&lt;br /&gt;Item located = item_File_thumb.createRelationship(&amp;quot;Located&amp;quot;, &amp;quot;add&amp;quot;);&lt;br /&gt;located.setProperty(&amp;quot;related_id&amp;quot;, &amp;quot;67BBB9204FE84A8981ED8313049BA06C&amp;quot;); // default vault&lt;br /&gt;IomFactory factory = new IomFactory();&lt;br /&gt;Aras.IOME.CheckinManager cm = factory.CreateCheckinManager(item_File_thumb);&lt;br /&gt;Item result = cm.Checkin(1);&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;&lt;span style="background-color:#ffffff;"&gt;ERROR: C8DE3EDD488C41F7BD10F99FA5ACDE82.&lt;br /&gt;Details in 6 temporary files&lt;br /&gt;C:\Program Files (x86)\Aras\Innovator\Innovator\Server\dll\ng5om2ao&lt;br /&gt;Line number 1, Error Number: CS1003, Syntax error, &amp;#39;(&amp;#39; expected&lt;br /&gt;Line number 1, Error Number: CS1026, ) expected&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: upload a  simple file to vault</title><link>https://www.aras.com/community/thread/4084?ContentTypeID=1</link><pubDate>Thu, 12 Dec 2019 16:39:38 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:2549cee5-665d-41be-9e32-00f370397844</guid><dc:creator>DucTran</dc:creator><description>&lt;p&gt;It&amp;#39;s work!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The code is correct, the path is correct, file permission is enough. I missing package System.Data.HashFunction in my project.&lt;/p&gt;
&lt;p&gt;Thanks you Angelalp and Chris very much ^^&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: upload a  simple file to vault</title><link>https://www.aras.com/community/thread/4078?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2019 16:48:54 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:15be7a13-5f98-4ccd-a2ee-69e37911a67a</guid><dc:creator>Christopher Gillis</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;As Angela has said, I&amp;#39;m not seeing anything wrong with your code itself. I tried running the same code in an IOM app on my local machine, and I was able to upload the file successfully. For reference, the exact code I used can be seen below:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt; // Login variables defined above and intentionally left out of sample&lt;/em&gt;&lt;br /&gt;&lt;em&gt; HttpServerConnection conn = IomFactory.CreateHttpServerConnection(url, database, username, password);&lt;/em&gt;&lt;br /&gt;&lt;em&gt; Item res = conn.Login();&lt;/em&gt;&lt;br /&gt;&lt;em&gt; // Make sure we logged in correctly&lt;/em&gt;&lt;br /&gt;&lt;em&gt; if (res.isError())&lt;/em&gt;&lt;br /&gt;&lt;em&gt; {&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; &amp;nbsp; Console.WriteLine(&amp;quot;Could not log in&amp;quot;);&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; &amp;nbsp; return;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; }&lt;/em&gt;&lt;br /&gt;&lt;em&gt; // Upload the file&lt;/em&gt;&lt;br /&gt;&lt;em&gt; Innovator inn = new Innovator(conn);&lt;/em&gt;&lt;br /&gt;&lt;em&gt; Item file_upload = inn.newItem(&amp;quot;File&amp;quot;, &amp;quot;add&amp;quot;);&lt;/em&gt;&lt;br /&gt;&lt;em&gt; file_upload.setProperty(&amp;quot;filename&amp;quot;, &amp;quot;test.txt&amp;quot;);&lt;/em&gt;&lt;br /&gt;&lt;em&gt; file_upload.attachPhysicalFile(@&amp;quot;C:\Temp\test.txt&amp;quot;);&lt;/em&gt;&lt;br /&gt;&lt;em&gt; file_upload.apply();&lt;/em&gt;&lt;br /&gt;&lt;em&gt; // Check that the file uploaded successfully&lt;/em&gt;&lt;br /&gt;&lt;em&gt; if (file_upload.isError())&lt;/em&gt;&lt;br /&gt;&lt;em&gt; {&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; &amp;nbsp; Console.WriteLine(&amp;quot;Could not upload file&amp;quot;);&lt;/em&gt;&lt;br /&gt;&lt;em&gt; }&lt;/em&gt;&lt;br /&gt;&lt;em&gt; // Let us know if the file uploaded successfully&lt;/em&gt;&lt;br /&gt;&lt;em&gt; Console.WriteLine(&amp;quot;File uploaded&amp;quot;);&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This leads me to believe that the issue is not with your code itself. I think the issue might be that the computer permissions on the physical file itself might be preventing this upload. Could you try to check those permissions (in the Windows explorer,&amp;nbsp;&lt;strong&gt;Right-click -&amp;gt; Properties -&amp;gt; Security&lt;/strong&gt;)?&amp;nbsp;Could&amp;nbsp;you also try to upload the same file as the same user through the Innovator client?&lt;/p&gt;
&lt;p&gt;Chris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: upload a  simple file to vault</title><link>https://www.aras.com/community/thread/4077?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2019 15:09:35 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:3caaf730-7246-4ecc-900b-27732fac1807</guid><dc:creator>DucTran</dc:creator><description>&lt;p&gt;I make a stand alone application with&amp;nbsp;Aras API, it&amp;#39;s not a server method. My file and path on local PC.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The path on local PC is correct.&lt;/li&gt;
&lt;li&gt;The permission of item is enough&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;but it&amp;#39;s still not working and no return error :(&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: upload a  simple file to vault</title><link>https://www.aras.com/community/thread/4075?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2019 13:41:57 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:cb2ae55c-a273-4de0-a46c-6f8c22440f22</guid><dc:creator>AngelaIp</dc:creator><description>&lt;p&gt;The Method is intended that you upload files to the Vault that are somewhere on the&amp;nbsp;server. The folder in my example is some temporary folder I created at the C: drive. You normally just story files temporary there and immediately delete them after upload to the vault. The server Method will not work when you want to upload files from client side.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: upload a  simple file to vault</title><link>https://www.aras.com/community/thread/4074?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2019 13:17:03 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:07492ac1-53d7-4667-8b6b-617bac9c9709</guid><dc:creator>DucTran</dc:creator><description>&lt;p&gt;I sure my path is correct.&lt;/p&gt;
&lt;p&gt;The &amp;quot;server folder&amp;quot;, your mean is the VAULT FOLDER on server? The VAULT FOLDER is read only by default, I do not edit anything.&lt;/p&gt;
&lt;p&gt;I can create new File (TOC &amp;gt; File Handling) by manual, so i think the permission for File item is enough.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: upload a  simple file to vault</title><link>https://www.aras.com/community/thread/4073?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2019 11:29:06 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:026d8db0-ce10-4a5c-98aa-b1b045fbc442</guid><dc:creator>AngelaIp</dc:creator><description>&lt;p&gt;Is your path correct? Do you have changed the permission in your server folder so Innovator can access the folder (if you don&amp;acute;t use a codetree location)?&lt;/p&gt;
&lt;p&gt;string fileString = &amp;quot;bestfileever.txt&amp;quot;;&lt;br /&gt;string path = @&amp;quot;C:\\temp\\Aras\&lt;span&gt;\&lt;/span&gt;test\\&amp;quot; + fileString;&lt;/p&gt;
&lt;p&gt;Item fileItem = inn.newItem(&amp;quot;File&amp;quot;, &amp;quot;add&amp;quot;);&lt;/p&gt;
&lt;p&gt;fileItem.setProperty(&amp;quot;filename&amp;quot;, fileString);&lt;br /&gt;fileItem.attachPhysicalFile(path);&lt;br /&gt;Item checkin_result = fileItem.apply();&lt;/p&gt;
&lt;p&gt;if (checkin_result.isError()){&lt;br /&gt; inn.newError(&amp;quot;Error&amp;quot; + checkin_result.getErrorDetail());&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: upload a  simple file to vault</title><link>https://www.aras.com/community/thread/4072?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2019 11:24:29 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:f3d5bc0c-3caf-4114-96fd-899741a3f3a8</guid><dc:creator>DucTran</dc:creator><description>&lt;p&gt;I have already remove &amp;quot;this&amp;quot; but it&amp;#39;s still not working T__T&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: upload a  simple file to vault</title><link>https://www.aras.com/community/thread/4071?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2019 11:19:36 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:38e4a9b2-a0ec-4367-811b-e72a58672f7b</guid><dc:creator>AngelaIp</dc:creator><description>&lt;p&gt;Your first variant should do the job already, but &lt;span&gt;&amp;nbsp;this.inn.newItem does looks strange. Have you tried inn.newItem?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>