util.getURL() error when attempting to retrieve file from Ragic

Continuing the discussion from problem with downloading files:

Using Ragic’s Javascript workflow, I’m attempting to get a file stored in Ragic, then send it to a system external of Ragic.

I’m attempting to read the file content into a variable using this code line:

var file_content = util.getURL("https://na3.ragic.com/sims/file.jsp?a=mycompanyname&f=" + file_name);

When I execute the code within my Ragic sheet, I get this error:
URL-error

If I copy this URL and paste it into a web browser tab, it successfully shows the file.

Yes, I am familiar with the rule that an authentication must occur before attempting to retrieve a file. I am able to successfully authenticate then download the file using Postman.

Perhaps the problem is that the Javascript workflow is executed internally on Ragic’s servers whereas my Postman activity comes from outside Ragic.

Can someone please guide me on using Ragic’s Javascript to retrieve a file and store its contents in a variable?

Thank you.

1 Like

Hi,

Ragic developer had replied via Email. Let us know if you need further assistance!

"According to our javascript workflow error log, we noticed a blank space in your file name.
Whenever you click on a Ragic file URL, we automatically encode special characters to UTF-8 format, which may lead to an error when you concat your file name without encoding.

Always ensure that you encode your file name before concatenating it with the target URL."