Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hey, I am trying to import an SVG Image into ThingWorx 8.5.4-b222.
Unfortunately I am getting following error message:
"Import failed: invalid length"
Can someone help?
Cheers Fynn
Solved! Go to Solution.
Hi @IoT_Fynn
Yes it appears the way to upload svg is via dynamic content as you did.
If you check the Help Center Media page, it indicates
"Locally-stored media entities support JPEG, PNG, and BMP image types. To use other file types, refer to them as dynamic content and modify the supportedMediaEntityContentTypes parameter in the platform-settings.json file to include the desired MIME-type."
I think that follows the behaviour you are seeing.
Regards
Christophe
Hey Sharon,
thank you for your quick reply! I put the Image in the appendix. But it did not work with any svg that I tried so far.
Regards
Fynn
Hi @IoT_Fynn
I am not sure how you are importing your svg file but if that is via a Media entity, currently ThingWorx does not allow it.
I'd recommend voting for this ThingWorx idea to give it more weight to be taken into considerations for future release.
Christophe
Oh okay. Yes i am doing it via Media entiy. There are strong hints, that you can import and svg file in TW 8.5. At least i tought so. If you have a look at the 8.5 platform-settings.json you can see this line:
"supportedMediaEntityContentTypes": [
"image/svg+xml"
So are you sure that svg is not supported in ThingWorx 8.5?
There is a workaround. I can give the Media entity the URL of an SVG image. But for that I have to upload the svg image to my repository so I would rather use the "normal" way and upload it.
Hi @IoT_Fynn
Yes it appears the way to upload svg is via dynamic content as you did.
If you check the Help Center Media page, it indicates
"Locally-stored media entities support JPEG, PNG, and BMP image types. To use other file types, refer to them as dynamic content and modify the supportedMediaEntityContentTypes parameter in the platform-settings.json file to include the desired MIME-type."
I think that follows the behaviour you are seeing.
Regards
Christophe