Highlighted
Respected Contributor.. Respected Contributor..
Respected Contributor..
629 views

JS readFile() does not working in web client

Jump to solution

Hi, experts. I have one problem with working readFile() function in JS. I created wizard with which must take file from user and read its as binary, so i use formdesigner element "file", in input i wrote variable $attach. In wizard's Actions tab i wrote this code:

try
{
      var str = readFile(vars.$attach, "B")
}
catch (ex)
{
      print(ex)
}

But it does not work, after click Finish button in wizard there is error: "Unable to open file 45c581da559d78160155bbdbcc020090/1.txt for reading", this error is everywhere except HP Service Manager Client that installed on server there HP Service Manager Server installed.

Have any ideas what is it?

P.S. HP Service Manager Server v9.41.3016

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.. Absent Member..
Absent Member..

Hi,

I also think of the same. Attachment must be uploaded first. In my environment, I used SCFile.insertAttachment( attachObj ); method. But make sure that before calling insertAttachment, you must establish a current record using either getNext() or doSelect().

Hope that helps.

Regards,

Avi

View solution in original post

0 Likes
3 Replies
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

readFile will only work on the Service Manager Server host!

 

you have to upload the attachement first, and then read it from the SYSATTCHEMENT table.

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Hi,

I also think of the same. Attachment must be uploaded first. In my environment, I used SCFile.insertAttachment( attachObj ); method. But make sure that before calling insertAttachment, you must establish a current record using either getNext() or doSelect().

Hope that helps.

Regards,

Avi

View solution in original post

0 Likes
Highlighted
Respected Contributor.. Respected Contributor..
Respected Contributor..

Made it with attachments, but how it works in import in database manager? There you can choose file in wed client and it will be proceed in HPSM?

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.