- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2018 01:46 PM
Using the blog below I was able to setup a pdf file to be posted on the mid server.
http://www.john-james-andersen.com/blog/service-now/javascriptprobe-and-mid-server-script-includes.html
Is it possible to control the folder path where the file is posted to? Currently it is posted directly in the agents folder.
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2018 06:46 AM
Hi Snowtech,
In the execute method there is one line of code where you can say where to put that file like C drive etc.
var f = new this.File(this.filename);
instead have it like this
var filePath = 'C:/Mid Servers/mid.helsinki/agent/export/customFolder/' + this.filename;
var f = new this.File(filePath);
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2020 07:12 PM
Hi Ankur,
Need your help in resolving issue of file not getting created in folder on MID Server. I can see entries in the ECC Queue. Can you please provide some steps to resolve this issue?
var jprobe = new JavascriptProbe(mid_server);
jprobe.setName('test'); //any name can be given
jprobe.setJavascript('ms.log("JaveScriptProbe is working");var fileTransfer= new ExportToMIDServer(); fileTransfer.execute();');
jprobe.addParameter('source', mid_server_temp_path);
jprobe.addParameter('filename', file_name);
jprobe.addParameter('filePayload', base64EncodeString);
jprobe.create();
Thanks,
Ashraf