tags:

views:

199

answers:

3

Why do I get a 400 - bad request error using the following URL? It is encoded using Server.UrlEncode. The actual path query parameter is C:\Development\Chase\Exports\ChaseExport-090312073930.zip

http://localhost:50199/Common/Forms/Export_Stream.aspx%3fpath%3dC%3a%5CDevelopment%5CChase%5CExports%5CChaseExport-090312073930.zip
+4  A: 

You should not urlencode the entire querystring, just the values, so URL should be

http://localhost:50199/Common/Forms/Export_Stream.aspx?path=C%3a%5CDevelopment%5CChase%5CExports%5CChaseExport-090312073930.zip

Spikolynn
Turns out it works with no encoding at all, literally as is.
ProfK
+1  A: 

Try this:

http://localhost:50199/Common/Forms/Export_Stream.aspx?path=C%3a%5CDevelopment%5CChase%5CExports%5CChaseExport-090312073930.zip
Eric Petroelje
+1  A: 

I've written an article with Stefan's help that explains how to do this:

Experiments in Wackiness: Allowing percents, angle-brackets, and other naughty things in the ASP.NET/IIS Request URL

Scott Hanselman
Thanks Scott, that article looks great.
ProfK
Thanks you! I tried.
Scott Hanselman