jenC - Monday, February 21, 2011 2:44 PM:
Hi, I am following the example provided by Peter here: http://www.aras.comhttp://www.aras.com/Community/forums/p/232/609.aspx#609
I've created a stand alone website for users to upload files to the innovator vault. It will eventually have document wrapping and versioning but for now, I'm starting simple.
So basically I've got this: (Peter's code)
Dim File As Item = MyItem.newItem("File", "add")
File.setProperty("filename", filename)
File.setProperty("actual_filename", pathname)
File.setProperty("checkedout_path", pathname.Substring(0, pathname.LastIndexOf("")))
File.attachPhysicalFile(pathname, vDefaultVault)
I deployed the code to a webserver and when I run it from that webserver, it works fine and my file gets added to the vault, no matter what file I choose (something local, something on a shared drive, a network folder, etc.)
But when I access the website from any other box (my local machine for instance). File.Exists(filename) always fails (which is one of the first things the IOM's attachPhysicalFile checks)
I know this is a permission issue and not an innovator issue but if anyone has ideas of how to get this resolved I'm all ears. I altered the code to use an input type of File, and then used the SaveAs method to copy the file to a temp directory on the web server and pass that to attachPhysicalFile which works everywhere but I'm trying to avoid having the file copied twice. I also tried:
FileIOPermission fp = new FileIOPermission(FileIOPermissionAccess.AllAccess, pathname);
fp.Assert();
And while that code didn't give me any problems, it also didn't do anything.
What is the key to getting Peter's code to work and get around the permission issues?