File Download server action

Can I use the File Download server action with an image file.

My action file, loads an image, resizes it, adds a watermark, and saves the output to a folder, each time i add the File Download step at the end of that, it just does nothing, like it completely ignores the step. If I change the path of the download to something I know is incorrect, then it does error out with a 500 file not found error though.

If it makes any difference, I am using docker with digital ocean and the download is coming from the user uploads folder.

File download is designed to work as a direct API call. Not from AJAX.
So if this SA is being called from SC or SCForm on the page, it will not work.

What I can suggest is to just return the path (or some unique ID) from this SA and then use a file-download step on client side to download the file.

OR, another option is to create a separate SA just for file download.
Then create a SC Route in routing panel for this SA.
Finally, on response of SC/Form on the page, redirect the page to that SC Route with the uniqueID/path as parameter.

1 Like

Thanks Sid, yeah I eventually went the same idea as you suggested with the client side download used on success of the image manipulation and passed that the URL. I have to admit I never realised the server action download step was not just as easy as giving it a URL and it downloads.