Created
March 22, 2013 20:35
-
-
Save wullemsb/5224531 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FilenameMultipartFormDataStreamProvider : MultipartFormDataStreamProvider | |
{ | |
public FilenameMultipartFormDataStreamProvider(string path) : base(path) | |
{ | |
} | |
public override string GetLocalFileName(System.Net.Http.Headers.HttpContentHeaders headers) | |
{ | |
var name = !string.IsNullOrWhiteSpace(headers.ContentDisposition.FileName) ? headers.ContentDisposition.FileName : Guid.NewGuid().ToString(); | |
return name.Replace("\"",string.Empty); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment