tablesmit / csexwb2

Automatically exported from code.google.com/p/csexwb2
1 stars 2 forks source link

Downloading files with funny chars problems #74

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Assign a handler to FileDownloadExEnd
2. Use it to download a file with a filename that can't safely be saved on
a Windows filesystem, like "Foo: bar.pdf"

What are the OS and IE versions?
- Windows Vista Ultimate -- Version 6.0 (Build 6001: Service Pack 1)
- Windows Internet Explorer 7 -- Version: 7.0.6001.18000

What exceptions are thrown? If any, please copy and paste the exception dump.
- (only in my own code, when I try to use this feature)

What is the expected output? What do you see instead?
- Usually, FileDownloadExEndEventArgs's "m_SavedFileNamePath" has the
absolute path to the file it downloaded, like @"C:\blah\blah\Foo.pdf".  But
if the web server gives it a filename which can't be safely saved on a
Windows filesystem, csEXWB will:
   - report the absolute path it tried to save to
   - crop the filename at the invalid char
   - create an empty file

That is, if you try to download "Foo: bar.pdf", it creates a 0-length file
at @"C:\blah\blah\Foo", and returns m_SavedFileNamePath=@"C:\blah\blah\Foo:
bar.pdf".

Please use labels and text to provide additional information.

IE7 itself apparently has a feature to avoid this: if you try downloading
the file manually in IE7, it saves it as "Foo__bar.pdf" or something.

Original issue reported on code.google.com by kengru...@gmail.com on 10 Mar 2009 at 5:17