Completed
Last Updated: 14 Mar 2014 10:34 by ADMIN
ADMIN
Hristo Valyavicharski
Created on: 16 Sep 2013 14:45
Category: AsyncUpload
Type: Feature Request
0
ADD: RadAsyncUpload should upload files, which names are invalid for Windows.

		
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
3 comments
ADMIN
Peter Filipov
Posted on: 14 Mar 2014 10:34
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;
    }
ADMIN
Peter Filipov
Posted on: 14 Mar 2014 10:33
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.
Larry Salveson
Posted on: 16 Sep 2013 16:35
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, "\ : / * ? " < > |".