Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
How to upload a local image file to be a MediaEntity by a service?
Where are you loading the Image from? If you can generate access it via a URL you can use
var params = {
tags: undefined /* TAGS */,
...
timeout: undefined /* NUMBER */
};
Resources["ContentLoaderFunctions"].LoadMediaEntity(params);
If the image is associated with a thing you can store it in a property of type image or the Avatar and then upload the image via a Repository using the FileUpload widget.
If you want to store multiple images I'd suggest a Data Table as I don't think you should be using Media Entries for dynamic data
Can you give some more background/say what you have tried so far?
Storing the images in Postgre DB to show specific images in mashup by database query(service) is fully able to meet the purpose of the first set.
But the stored data type is bytea (binary data), and I didn't find the solution to convert bytea to image directly in ThingWorx.
Then I tried to store the image locally(such as D:\)and stored the path in DB.But the sourceURL of image widget doesn't support path of image.
So I want to upload local images to be a MediaEntity by a service.
I'm not sure how much of an effect using Postgre DB will have but I'm new to TW07. Is the problem showing the image in a Mashup? if it is you can use a Value Display to show an image in a property.
Can you take a look at this code - It shows an image stored in a property without needing the URL that the Image widget requires