This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Programming Example 7.28 - Not working correctly

rif6894 - Sunday, April 1, 2012 12:00 AM:

I have copied Programming Example 7.28 as a client side, java-script method, and created the associated Action.

However, when I execute the program it fails to download the file to the local directory. The error is the "Unable to retrieve the file from the vault". I have tried removing the authentication for the vault server, but it still does not work. The file does download if the fieURL value is pasted into a browser - indicating the all meta-data (filename, type and vault) are correct.

Any suggestions would be appreciated

 

// Prompt the user for the file name and retrieve the File item
var fileName = prompt("Enter the File Name:","");
var innovator = this.getInnovator();
var fileItem = innovator.getItemByKeyedName("File",fileName);
if (fileItem.isError()) {
top.aras.AlertError("File Not Found: " +fileItem.getErrorDetail());
return;
}
// Get the URL to the file and download it
var fileURL = top.aras.getFileURLEx(fileItem.node);
var folder = top.aras.vault.GetWorkingDir();
var results = top.aras.vault.downloadFile(fileURL);
if (!results) {
top.aras.AlertError("Unable to retrieve the file from the vault");
return;
}

 

and for the VaultServerConfig.xml

<enforce_user_credentials>0</enforce_user_credentials>



Yoann Maingon - Tuesday, April 3, 2012 7:41 AM:

just a quick check, what is you working dir ? 

if it is still the default c:/ it might be an issue. Try changing that one.



rif6894 - Tuesday, April 3, 2012 8:06 AM:

Yoann, thanks for your response.

The default directory, as a property in the program, is c: emp

I also tried a read/write share and still no luck

Any further suggestions?

 



rif6894 - Tuesday, May 22, 2012 7:24 PM:

I have re-tested this example, and it seems my abbrievated code does not work; But the original code works, providing the code portion

if (!results) {
top.aras.AlertError("Unable to retrieve the file from the vault"); return;
}

is commented out. So this issue may be considered closed.