Good morning - I'm hoping someone can help me here. I'm wondering what is the significance of the property Checkedout Path when adding a file to the vault manually.
I have the following code that takes a PDF file from a data structure that I am passing in to the method, writes the physical file out and then checks the file into the Vault.
phyFile = @"D:\\Temp\\" + fileName;
FileStream fs = new FileStream(phyFile,FileMode.OpenOrCreate);
fs.Write(matRecord[0].h_report_blob,0,matRecord[0].h_report_blob.Length);
fs.Close();
Item newReport = inn.newItem("File", "add");
newReport.setAttribute("doGetItem", "0");
newReport.setProperty("Comments", "Materials Report");
newReport.setProperty("file_type", pdfType.getProperty("id"));
newReport.setProperty("filename", fileName);
newReport.attachPhysicalFile(phyFile);
newReport = newReport.apply();
if(File.Exists(phyFile))
{
File.Delete(phyFile);
}
Once this code is complete, I can search the physical vault on my machine and I can see that the file has been created in the vault, and it has been deleted from the local file system from where I attached it. When I go to view the physical file from within Aras, my machine actually gives me a Blue Screen of Death (BSOD) and completely crashes. In attempting to try and figure out what is going on, I commented out the last section of code to delete the file from the local file system. When I do that and I view the file from within Aras, it displays perfectly.
If I take the @"D:\\Temp\\" + section out of the code, where I would expect it to write to the Innovator\Server\Temp folder (I'm guessing on this), I get an Object: Object error.
Can I remove the file from the path that it is check in from? Is this the problem that Aras is creating a link to the path from which it is being checked in from and when that file is deleted, it is causing all kinds of problems? I would think that I would be able to just view it seeing that it has actually been created in the vault. Is there somewhere that I can check to see the physical vault location property of the file when it is checked in?
TIA for the help!!!