path = Path(__file__).parent / "my_file.txt"
np.savetxt(path, np.asarray(points), delimiter=',')
file_from_path = viktor.File.from_path(path)
print(file_from_path.getvalue())
storage.set('from_path', data=file_from_path, scope='workspace')
I am trying to Store data using File.from_path
, but once I set them, I have multiple errors.
The File
is generated correctly because I am able to get the value and print it.
I don’t know if this is could be considered a bug.
Hi Mirco,
Does this error occur specifically when using Storage
in combination with a File
created from a path or when using Storage
in general? Could try one of the examples from the docs?
Regards,
Raoul
This happens for that specific case.
I used Storage
passing a string as you can see here without issues.
Also I still have some trouble grasping when I should use entity or workflow.
Unfortunately, the example you sent works without problems on my machine.
The error message also leads me to believe that it is network related. Do you know, or could you check with your IT department, if there are any restrictions on the domains listed here? I don’t really understand yet why this would occur on this specific case.
With respect to the scope
parameter:
- entity : when data needs to be accessed within a specific entity
- workspace : when data needs to be accessed workspace-wide
This means that when you set the scope to entity
you can only access the data in that specific entity. If you set it to workspace
you can access data throughout the entire app.
Yes, I can confirm is a network problem.
I need to review the restrictions with IT.
Thanks for the support.