Confused on create-img :url-src #160
-
So far I have been unable to give create-img a :url-src filename that is outside the static route and have it work. My current process is to override the static-route in the initialization (pointing to a directory in my own project), copying all the necessary files. I then generate svg diagrams in a sub-directory of that new static route. Then if a user wants to load a diagram, they can use server-file-dialog to find it, but then I have to drop everything in the returned pathname except the file-namestring. It works, but I feel like I am missing something obvious. (Then I need to figure out how to add zoom in and out to the image view - the svg diagrams get large). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
The issue is that the :url-src has to be served from a webserver not a local file it is a security limitation. You can try using a file URL file:///Users/dbotton/Desktop/advanced%20format.pdf if your app is run on 127.0.0.1 it should work. |
Beta Was this translation helpful? Give feedback.
-
BTW (directory-namestring path) will strip out just the dir portion of path |
Beta Was this translation helpful? Give feedback.
The issue is that the :url-src has to be served from a webserver not a local file it is a security limitation. You can try using a file URL file:///Users/dbotton/Desktop/advanced%20format.pdf if your app is run on 127.0.0.1 it should work.