Hi, I searched this forum and other ones but did not come across a solution to my problem and reading source code for the class did not help me either... I hope someone will help me figure this one out.
I have an application which uses the MultipartRequest class to upload files. To avoid name conflits I simply use the DefaultFileRenamePolicy object which appends 1, 2, 3 to file names... That works fine and I want to keep it this way. But my users will submit files with names containing non-ascii characters which are a problem for me. They also submit files with names as long as 100 chars.
I would like to intercept the upload process and rename the file myself somewhere along this logic:
1. Get file name submitted by user
2. Replace all non ascii chars to "_"
3. Cut file name to 25 chars
4. Force upload process to use the new file name as destination name.
5. Let DefaultFileRenamePolicy rename the file if one by that name exists.
I need help understanding where this interception should take place. I am not asking how to replace a character in
string or how to cut the file to 25 chars.
Can anyone help?