Today I met a problem, this is strange for me, but maybe not for experts in the C # field.
I have a function called Download like this (piece of code!)
public void Download (string path){ HttpContext.Current.Response.ContentType = "application/octet-stream"; try { ....
If the file name specified and stored in the path / filePath variable contains a space, for example
PR SimpleTest.xls
then the file name, for example PR , is indicated in the download field, and nothing more.

If this name has NO space (for example, PR_SimpleTest.xls ), the header comes with PR_SimpleTest.xls and I can load it as such (the full file name appears with its extension).
Is there a solution to solve the problem if the file name contains spaces?
source share