How to upload image into image field
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 07:28 AM
Hi,
I have a task to upload to all users in sys_user table an image from db_image table ('robot.png) into photo field in sys_user table.
What am I doing wrong?
var img_name = 'robot.png';
var img_sys = '8ca915f2b810311020d2e07b34d7565d';
var ga = new GlideSysAttachment();
var gr = new GlideRecord('sys_user');
gr.query();
while(gr.next()) {
ga.copy(img_name, img_sys, "sys_user", gr.sys_id.toString());
}
0 REPLIES 0