This is not about encoding URLs its more to do with a problem I noticed where you can have a valid filename on IIS sucha as "test & test.jpg" but this cannot be downloaded due to the & causing an error. There are other characters that do this also that are valid in windows but not for web.

My quick solution is to change the filename before saving using a regex below...

```
    public static string MakeFileNameWebSafe(string fileNameIn)
    {
        string pattern = @"[^A-Za-z0-9. ]";
        string safeFilename = System.Text.RegularExpressions.Regex.Replace(fileNameIn, pattern, string.Empty);
        if (safeFilename.StartsWith(".")) safeFilename = "noname" + safeFilename;

        return safeFilename;
    }

```

but I was wondering if there were any better built in ways of doing this.