Vault server URL error while uploading a file using my code. Thanks.

オフライン

Hi Guys,

I use my code to upload a file into system by using "item1.attachPhysicalFile(filePath)", however I got the error as the screenshoot below, then it also said :
 Side Error" 2nd: "Failed to upload the files. Is the specified Vault Server URL: ""http://192.168.6.60/InnovatorServer/vault/vaultserver.aspx" " correct ?" 
 
It seems I did not make any changes of Vault settings. However, thanks in advance.  --Jen Li
Parents
  • Hi Jenli,

    Can you confirm that you're able to upload a file manually?

    AJ

  • オフライン in reply to AJ Sebastian

    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

  • オフライン in reply to Jenli

    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

  • オフライン in reply to AJ Sebastian

    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

  • オフライン in reply to Jenli

    It seems that once the code run into item1.attachPhysicalFile(filePath), then it get the vault error I sent to you. Thanks.

Reply Children
No Data