Skip to main content
1-Visitor
July 24, 2019
Solved

Upload and display image from local without using File Upload widget

  • July 24, 2019
  • 1 reply
  • 2866 views

Hi all,

Like the subject, I'd like to upload and display an image into Mashup without using File Upload widget. Is there any way to perform it?

Any help is appreciated.

Thanks.

Best answer by Constantine

Hello,

 

Something like that is probably nearly the best result you can achieve easily without developing your own JavaScript extension.

2019-07-25 10_20_14-ImageUploaderMashup.png2019-07-25 10_20_41-ImageUploaderMashup.png

See mashup code attached. I exported it from 7.4, but it should load in 8.x. Please let me know if it doesn't work.

 

/ Constantine

1 reply

18-Opal
July 24, 2019

Hello,

 

Do you want a user to upload it through his web browser, or some external program through some scripting? If latter, then the answer depends on a kind of external program that you have. Just a couple of examples:

 

  1. A .NET application on a remote Windows host
    1. Can use EDGE SDK for Java to upload the file
    2. Can execute a REST call using HttpClient class
    3. Can map a ThingWorx FileRepository to a local directory via Samba (Windows file sharing protocol)
    4. ...
  2. A Bash script on the same network
    1. Can upload files via REST calls using curl
    2. Can map a FileRepository directory via NFS
    3. Can upload files via ftp, rsync, scp, ...
    4. ...
  3. ...

If you want a user to upload a file through his web browser, then what's wrong with the standard FileUpload widget?

 

Basically, you need to explain in more detail what you are trying to achieve.

 

/ Constantine

Quannd1-VisitorAuthor
1-Visitor
July 25, 2019

Hello Constantine,

Actually, I would like to create a "custom widget" like "SaveImage" in FileRepository. For more details, please check the attachment.

Thank you.

18-Opal
July 25, 2019

Hello,

 

Something like that is probably nearly the best result you can achieve easily without developing your own JavaScript extension.

2019-07-25 10_20_14-ImageUploaderMashup.png2019-07-25 10_20_41-ImageUploaderMashup.png

See mashup code attached. I exported it from 7.4, but it should load in 8.x. Please let me know if it doesn't work.

 

/ Constantine