Mark-sai Respected Contributor.
Respected Contributor.
552 views

.Net SDK upload file to the record using InputDocument

Jump to solution

Hi,

I am trying to upload a document to a record using .Net SDK and calling it from a webapi. I manage to create the record and retrieve the record (that means my access set up in the webapi is working fine). But when I try to access the file path using InputDocument.SetAsFile(filepath) I get Access denied error. For testing purpose, i have given that file path everyone full access.  The following is the code piece. I have the error at objDoc.SetAsFile(inputFileUNC).

Record objRec = new Record(objDB, recNumber);
InputDocument objDoc = new InputDocument();
objDoc.SetAsFile(inputFileUNC);
objRec.SetDocument(objDoc, false, false, "Created via SDK");
objRec.Save();

 

Thanks,

0 Likes
1 Solution

Accepted Solutions
Highlighted
Mark-sai Respected Contributor.
Respected Contributor.

Re: .Net SDK upload file to the record using InputDocument

Jump to solution

Sorry my bad. Found out it is the issue with my UNC path. Seems to be resolved now. Thanks

0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

Re: .Net SDK upload file to the record using InputDocument

Jump to solution

So this is a Windows error right?  Access denied to the folder?

What identity is the IIS App Pool running as, are you sure you have access to the path at the time you call SetAsFile()?


Blog | Samples | HPE CM 9.3 SDK Docs
**Any opinions expressed in this forum are my own personal opinion and should not be interpreted as an official statement on behalf of MicroFocus**
Mark-sai Respected Contributor.
Respected Contributor.

Re: .Net SDK upload file to the record using InputDocument

Jump to solution

Hi,

Yes IIS pool is running as the account which has admin rights on that folder. And just to be sure I have set that folder to have everyone full control . I think RM SDK could not access that folder.  

0 Likes
Highlighted
Mark-sai Respected Contributor.
Respected Contributor.

Re: .Net SDK upload file to the record using InputDocument

Jump to solution

Sorry my bad. Found out it is the issue with my UNC path. Seems to be resolved now. Thanks

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.