Forum Discussion
Ok, as I thought it was easier than what I was trying.
With "getFileChecksum" we get the value from the HASH without any problem, but we have to pass the value through a "file object" and I don't know how to pass the filepath through a variable, for example "filename".
[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3b915065-7661-4a3f-882f-c7425b911cfe:type=text&text=aras.vault.selectFile%28%29.then%28function%28file%29%20%7B%0A%09alert%28%20aras.vault.getFileChecksum%28file%29%29%3B%0A%09%0A%09%0A%20%20%20%20var%20fileName%20%3D%20%22C%3A%5C%5CUsers%5C%5Cfernando.coronil%5C%5CDownloads%5C%5CPrueba.TXT%22%3B%0A%09alert%28%20aras.vault.getFileChecksum%28fileName%29%29%3B%0A%09%0A%09%7D%29%3B%0A]
Line 1-2 works fine.
Line 5-6 i get an error: "undefined".
I try too to load the file object in the itemType "Document":
But nothing. i dont know how i must to get this as an file object. [emoticon:6f61a5a028b641cb925f8551a1059cc2]
Hi,
great use case! I tried something similar 7 years ago, but only tried to match names and inform the user that duplicates exists. But I never used the draft.
It´s true that Innovator doesn´t use the checksum in any way.
Where do you trigger your aras.vault.select function? Do you currently only use the Method editor? Or did you overwrite the relationship file selector?
When your function is just used in a JS Method, the "undefined" error makes sense. You use aras.vault to pick a file. "File" is your fileobject. You use it in the alert to get the checksum. So far everything fine.
Then you write a path to a local file and use this one to get the checksum. This will not work, at least not in todays world (previous browsers from the 90s had some options...). JS itself cannot read local content automatically. That´s a security constraint. Just imagine every website in the world would have the potential power to read your local desktop content. So JS can only work with files, actively provided by the user with a file picker.
There are more flexible upload file options available than the aras.vault selector. But it depends on your overall usecase. At which point of the upload process do you want to do the checksum check?