Where to upload PDF or WORD docs for All Authenticated Users?

G24
Kilo Sage

I like the functionality provided by the Images table (db_image).  I like these features:

 - I am able to easily upload an image there.

 - The image goes into a single record (as far as I can tell).

 - I can change the image without changing the sys_id of the record itself.

 - The record gets captured by my Update Set for easy deployment.

 - When I upload the image, I am automatically provided with a link where any user (?) can access the image.

 

I want that SAME FUNCTIONALITY but for a PDF or WORD document. I need for the document to be downloadable by ANY AUTHENTICATED USER.  What is my best option?

 

I've run into the following problems with the following techniques:

1) Managed Documents module - Does not support the User Criteria concept, so I can not make the document easily available to any authenticated user.  I have to know my exact users (or groups) ahead of time.

2) Knowledge Article - Not captured in Update Sets.  Not designed for easy deployment across instances.

3) Attachments Table.  Designed to be attached TO A SPECIFIC RECORD, and I can't find an appropriate record to attach to where All Authenticated Users will have access to it.

 

Please advise.  And thank you.

4 REPLIES 4

Mark Manders
Mega Patron

What is your exact requirement? Because it is related to external documents being available in the instance, so why would you want this on non PROD? Why not just use Knowledge for it?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

We do EVERYTHING on non-prod first, so we can test it, and move it through our regular SDLC process.

 

@Mark Manders  My exact requirement is to have Rich Text Controls in Catalog Items on the Employee Service Center which contain hyperlinks to individual PDF and WORD documents, available to all Employee Service Center users, which, when clicked, download the documents immediately (one click).

Maik Skoddow
Tera Patron
Tera Patron

Hi @G24 

 

great question and I have also spent some time before to solve that riddle. 

 

The reason ServiceNow does not offer anything similar to the images from the “db_image” table is that there would then no longer be a separation between your own documents and the files from the web server's file system.

 

Therefore, you would need a different approach where you have full control over the content of the response and the response headers sent, which are very important for retrieving files.

 

The only idea I've had so far is to build a Scripted Rest API method that loads an attachment and then writes the file to the output via response.getStreamWriter().writeStream(). That way you can also send the right headers like the content type or block the response if a user is not authenticated.

 

The only remaining question is where to save the documents. Either you create a custom table or use the record of the new Scripted Rest API method (table “sys_ws_operation”)

 

Maik

>The reason ServiceNow does not offer anything similar to the images from the “db_image” table is that there would then no longer be a separation between your own documents and the files from the web server's file system...

 

Meaning what?  That it would pose a security vulnerability?