- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2020 03:54 AM
Is there a way to directly upload an image as an attachment in a order guide/record producer and have it reflect there immediately like the profile page?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2020 10:15 PM
You can try another approach as below.
Keep HTML code as my previous comment, in client controller you can call server and in server side, you can query sys_attachment table to check the type of the attachment. then either you can clear attachment variable or show image based on validation result.
https://serviceportal.io/communicating-between-the-client-script-and-the-server-script-of-a-widget/
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2020 10:05 PM
Since I am creating this form for Service Portal , I have created a Macro and with input type field and checking validation , but unable to display the image via the event . I am trying something like this :
but the image is not getting attached
<div>
<input type='file' accept='image/*' onchange='openFile(event)'><br>
<img id='output'>
</div>
CSS:
img
{
height:90px;
width:90px;
}
Client Script :
var openFile = function(event) {
var input = event.target;
var reader = new FileReader();
reader.onload = function(){
var dataURL = reader.result;
var output = document.getElementById('output');
output.src = dataURL;
};
reader.readAsDataURL(input.files[0]);
};

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2020 10:15 PM
You can try another approach as below.
Keep HTML code as my previous comment, in client controller you can call server and in server side, you can query sys_attachment table to check the type of the attachment. then either you can clear attachment variable or show image based on validation result.
https://serviceportal.io/communicating-between-the-client-script-and-the-server-script-of-a-widget/
Thank you,
Ali

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2021 12:39 AM
Hello,
Hope you are doing good.
Please mark answer as correct to close the thread or let us know if you have query.
Thanks,
Ali
Thank you,
Ali