ProfK
ProfK

Reputation: 51104

Bad Request (400): Why?

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

Upvotes: 1

Views: 1240

Answers (3)

Scott Hanselman
Scott Hanselman

Reputation: 17702

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

Upvotes: 4

Eric Petroelje
Eric Petroelje

Reputation: 60549

Try this:

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

Upvotes: 1

Spikolynn
Spikolynn

Reputation: 4173

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

Upvotes: 4

Related Questions