var file = new FileStream(zipPath, FileMode.Open);
string fileName = //set a filename
var response = new StreamResponse(() => file, MimeTypes.GetMimeType(fileName));
return response.AsAttachment(fileName);
when filename is us letter, all ok.
when filename include chinese, client cannot get any response, but also no exception.
when I change AsAttachment section to :
AsAttachment("fixednamehere.xxx");
it goes well
so I guess is AsAttachment issue.
ps: if only include one or two chinese word, it still ok, client can download file, but got wrong filename. if it include many chinese word, it stuck
System Configuration
Nancy version:
Nancy host
[ ] Nancy.Hosting.Aspnet
[*] Nancy.Hosting.Self
[ ] Nancy.Owin ()
[ ] Other:
Other Nancy packages and versions:
Environment (Operating system, version and so on):
Prerequisites
DEBUG
andRELEASE
modeDescription
I want to return a file by url like: http://.../getfile?filename=xxxxx my code is like this:
when filename is us letter, all ok. when filename include chinese, client cannot get any response, but also no exception.
when I change AsAttachment section to : AsAttachment("fixednamehere.xxx"); it goes well
so I guess is AsAttachment issue.
ps: if only include one or two chinese word, it still ok, client can download file, but got wrong filename. if it include many chinese word, it stuck
System Configuration