download sys_attachment by public
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Good Morning Guys!
At the moment, i make a Widget and this is on a public site (no authication).
In this Widget i want to make downloading files from sys_attachment.
first of all, i used the url /sys_attchment?sys_id=<SYSID>, but if i am not logged in, i dont can download the file.
After this, i try to make a restapi.. but this doesnt have permission to the sys_attachments...
After this, i try with a base64.. but it doesnt work..
Here is my Code:
Server Script:
Client Controller:
Thanks and regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago - last edited 5 hours ago
Hi @CyrillW,
what would be your business requirement? Please explain who are the users who will be downloading the attachments, and why public?
ServiceNow instance is for a specific client, the users are employees of that company and they have account to access it (to keep security standards and traceability).
If you want to share documents for public (unauthorised) audience, why not use file hosting (e.g. Google Drive or any other)?
Is this a real project requirement or your idea to learn ServiceNow? It doesn't make sense to me :((
PS: you seem to duplicate the question into two threads and both seem to be selected incorrectly, this has nothing to do with API (this) and nor with Virtual Agent...
This reply is 100 % GlideFather and 0 % AI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago - last edited 4 hours ago
Hello @GlideFather
First of all, yes, I know it looks stupid. But we are building an Emergency Portal, and we need to make 4–5 files public in case the rest of the website is offline. This is a guideline from our company. We cannot host it on a platform like GitHub or Google Drive.
I accidentally sent the first post here and actually wanted to delete it (which doesn’t seem to be possible?).
Could you please tell me under which category this would fall? I don’t really understand where it belongs. I would be very grateful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi @CyrillW again,
it still doesn't make sense to me, why would you expect ServiceNow to be offline? Have your organisation experienced the instance to be offline? :)) it feels like bringing submarines to the mountains where there is no water... or what am I missing?
Even if it's public portal it's still on the same thing, so if the instance is offline, the publicly accessible portal would be down as well.
Please explain the scenario - what exactly is offline (and why do you think it would be)?
I don't think you can delete a posted question or you can try in the top-right corner there's a chevron with that option, but that might be for comments only. Just please avoid this in the future if possible.
Not sure what category would be relevant, I still don't understand what shall be done to be happy in the end of the day about this...
This reply is 100 % GlideFather and 0 % AI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Also hi @GlideFather again,
I don’t expect our ServiceNow instance to go offline, but everything else could be affected, such as email servers, the webshop, main website, etc.
Our company does not expect this to ever happen, but it is required by stock exchange regulations.
I can’t go into further detail at this point. The question remains: what can I do now? The files must be on the same server and publicly accessible. 😉
