Forum Discussion
Hi AJ,
Thank you for being here for our issue. For your question that I am able to upload to CAD File by using "Select New File" button on Manage file dialog with no problem. Please see the screenshot below.
I also put the default Vault pattern information and VaultServerConfig.xml file that you may need as following below, I am confused about any problems with the settings over there. thanks.
Best regards,
Jen Li
Hi Jen,
Could you please post a segment of the code you're using to attempt to upload files? This will give us better insight into what is actually happening in your environment,
AJ
- Jenli6 years agoCreator I
Hi AJ,
Below is the piece of code of getting specified file we need then upload the file into system.
***********************************************************************************
var item = parent.thisItem;
var NativeFileID = item.getProperty("native_file");
var qry = item.newItem("file", "get");
qry.setAttribute("select", "filename");
qry.setProperty("config_id", NativeFileID);
var res = qry.apply();
var file_name = res.getProperty("filename");
var filePath = "C:\\temp\\" +file_name;
var item1 = item.newItem('File', 'add');
item1.setProperty("filename", file_name);
item1.attachPhysicalFile(filePath);
var item1 = item1.apply();
if (item1.isError())
{
top.aras.AlertError( "error:" + item1.getErrorDetail());
}
else
{
return "Success!";
}***************************************************************************
Thanks a lot!
Best,Jen
- Jenli6 years agoCreator I
It seems that once the code run into item1.attachPhysicalFile(filePath), then it get the vault error I sent to you. Thanks.
- asebastian6 years agoCommunity Manager
Hi Jen,
The code you've sent is interesting, from a quick glance it looks like you're getting an existing file in the system, then getting it's filename property. You're then using this to create a filepath for your new File Item? Is this correct? Can you verify that whatever file you're trying to upload exists in the location C:/temp/{filename}?
Let me know if I'm misunderstanding the purpose of this code snippet.
AJ- Jenli6 years agoCreator I
Hi AJ,
Exactly, you get what I am doing through the code. For your concern, I did put a correct file in the location C:/temp/{filename}. However still pop up the vault URL error. Thanks.
Best,Jen