I am using ServiceStack for a simple web application. The main purpose is to let a user download a file. I am using an HttpResult as follows:
public class FileDownloadService : Service
{
public object Any()
{
string fileFullPath = "...";
string mimeType = "application/pdf";
FileInfo fi = new FileInfo(fileFullPath);
byte[] reportBytes = File.ReadAllBytes(fi.FullName);
result = new HttpResult(reportBytes, mimeType);
return result;
}
}
This opens a dialog in the user's browser and the user can specify where to save the file. A default name is specified, which is the name of the restPath of ServiceStack.
My question is: is it possible to specify a custom file name for when the user chooses to save (changing the default one)? I tried to work with HttpResult properties, but no luck. Thanks in advance!