Getting error "Message ::Invalid child path: Child path failed validation" while uploading file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Getting error "Message ::Invalid child path: Child path failed validation" while uploading file.
I have created a mashup which used the file upload widget to display an image using the image widget, i have created a service, which takes parameters from the file upload widget and then supplies the result to the image widget which is an image link.
Solved! Go to Solution.
- Labels:
-
Coding
-
Mashup-Widget
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Correct. You can either copy that link format and put it together with string concatenation, or you can programatically call that GetFileListingWithLinks service to get the correct URL for that image.
-- Nick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
It's not necessary to create the media entity to show your image in an image widget. You can create your url like this:
/Thingworx/FileRepositories/<path to image>/myImage.png
Bind that relative url to your image widget and it should show it.
- Nick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for the response Nick, so as i understand the path has to be changed like you have mentioned so i directly assigned the result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
It looks like 1.1.png is in the path twice. It will look something like this:
/Thingworx/FileRepositories/MyFileRepository/1.1.png
Did you create a new Repository Thing to put your images in or are they going in the System Repository?
I would suggest navigating to the File Repository thing and running the service GetFileListingWithLinks. That will give you the correct url format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Didn't create any file repository actually, what all i did was create a thing for supporting the mashup widgets for achieving the functionality and followed the solution 2 in this article : https://www.ptc.com/en/support/article/CS214785
I am not sure about how this part you mentioned "navigating to the File Repository thing" will be implemented, should i use the service you mentioned above "GetFileListingWithLinks" on the service which i created?
edit: did something like this :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Solution 1 and Solution 2 both involve creating a Repository Thing, which is a Thing with the File Repository base Template. When you added your Upload widget in your mashup, there should be an option to point it to that repository. After an image is uploaded to that repo, you should be able to look at the File Repository thing you created and run the GetFileListingWithLinks service. The output of that service will show you the correct format of link you should be outputting from your service.
- Nick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yes i have used the template you mentioned while creating a thing, also i checked in the properties that it is currently pointed to the system repository here and i have changed it to the repo thing which i am using.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Now:
1. Upload an image using that widget
2. Go to the Repository Thing you created and run the GetFileListingWithLinks service
3. Use that url format when you bind it to your image widget.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
So i uploaded an image in the mashup runtime, then went to the thing and ran the GetFileListingWithLinks service but got some error the file below is the one i had uploaded
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Leave the path and nameMask as the defaults and just run the service. That will show you all the files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
yes got the format of the files so i think i just have to set the result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Correct. You can either copy that link format and put it together with string concatenation, or you can programatically call that GetFileListingWithLinks service to get the correct URL for that image.
-- Nick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks, it works now!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Good to hear. Please 'Accept as Solution' so others know that the issue is closed.