Can we store a file in Freshdesk project structure

Hello guys,
I have a requirement like to download the attachments from a ticket and send them in the email as an attachment. So is there any way to download the attachment and store it in the project folder and fetch it from the folder and send it via email as an attachment?

-Soujanya.

Hey @soujanya
The short answer : NOPE! No file I/O. You can keep the data in memory and do the transforms.

The long answer: Storing files poses a complicated challenge for us. We would need to provide access for File I/O to the apps on our infrastructure (backend app) and also on the machine of whoever is running the app (for frontend use cases). This poses a modicum of security issues (from a platform perspective). Hence to keep it secure, we have knowingly stopped file I/O for apps (even if it works in your local FDK).

4 Likes

Hi @prithvi,

Thanks for your quick response. Can you let me know how to store a downloaded file in memory and how I can do actions on that file since I dont have any idea on that.

-Soujanya.

So I believe in the request npm if you directly just do a GET on a download URI, you get a string as it will always try to convert into a string. This answer would help you get the Buffer binary data which you can attach to the email client. Hope this helps.

3 Likes

Thanks, @prithvi, your solution helped me a lot to resolve my issue.

1 Like