Here are the steps that you need to follow: 1. Create custom handler. 2. Override the CheckOriginalFileNameForInvalidChars method to return always false. 3. Test under MAC to upload file with invalid char - \/ : *? " <> | - the upload should be successful 4. Test that after a postback the FileUploaded event is not fired for the uplaoded file 5. In order to fire the event you need to override the Process method and change the original file name not to contains invalid chars. E.g: protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName) { var test = CreateDefaultUploadResult<UploadedFileInfo>(file); test.FileName = @"myname.jpg"; return test; }
The issue is resolved in our latest internal build and it will be available in Q1.2014 SP1. Please test it and let me know if it works for you.
While we may not be able to alter the file name submitted by the user, you already modify the file name saved in the temporary folder by prepending the user's file name with a unique value. If at that time you replaced the invalid characters in the rest of the file name the error should go away. Mac users are able to specify file names for their files that are invalid in the Windows world (like on our server). Mac file names can start and end with blanks and might contain a character not allowed in Windows file names, "\ : / * ? " < > |".