|
Rank: Advanced Member Groups: Member
Joined: 11/13/2008 Posts: 43
|
Hi, I'm using the eo:Downloader to generate dynamic content (it's just a plain CSV file) and everything works fine in IE. However, I have a problem with Google Chrome. When I click the button to generate the dynamic content and download it, nothing happens. When I click on the "here" hyperlink in the Downloader's associated Label control, I get this error message: The length of the query string for this request exceeds the configured maxQueryStringLength value. Looking at the QueryString, it is indeed huge. I've tried disabling both ad blocker and popup blocker but it still doesn't work in Chrome.
Code: HTML/ASPX
<eo:Downloader runat="server" ID="Downloader1" DownloadButtonID="Button1" DirectLinkLabelID="Label1" DynamicContent="True" OnDownload="Downloader1_Download"></eo:Downloader>
<asp:Label runat="server" ID="Label1"></asp:Label>
<asp:Button Runat="server" ID="Button1" Text="Generate File & Download"></asp:Button>
Code: C#
protected void Downloader1_Download(object sender, EO.Web.DownloadEventArgs e)
{
NameValueCollection args = new NameValueCollection();
args["Filename"] = ViewState["Filename"].ToString();
args["FileContents"] = ViewState["FileContents"].ToString();
e.DynamicDownload(typeof(ContentGenerator), args);
}
private class ContentGenerator : EO.Web.DynamicDownloadContent
{
protected override void GenerateContent()
{
SetFileName(this.Arguments["Filename"].ToString(), -1);
byte[] buffer = Encoding.ASCII.GetBytes(this.Arguments["FileContents"].ToString());
Write(buffer, 0, buffer.Length);
}
}
|
|
Rank: Advanced Member Groups: Member
Joined: 11/13/2008 Posts: 43
|
As an update, I set a breakpoint on the following line:
Code: C#
SetFileName(this.Arguments["Filename"].ToString(), -1);
It breaks in IE but not in Chrome, which is really weird as it's server-side!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
You definitely do not want to pass your file content as an argument. All arguments will be encoded in the query string and that's why it can become so huge. Try pass some other key information as arguments, for example, an ID field as a key so that you can get the file content later based on that key.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 11/13/2008 Posts: 43
|
Thanks for the reply, but I'm obviously not explaining the problem clearly enough.
The file contents being passed as an argument consist of a header and a single line of data - around 50 bytes.
The problem is that when I debug the code in IE it jumps into the GenerateContent() code but with Chrome it doesn't.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
That's normal if the query string is too long. The downloader creates a separate request that carries all the arguments with the query string. When that request is processed, it calls your GenerateContent. In your case, the query string is too long which caused that request being rejected at the very first place. So it will never reach GenerateContent.
We tested Chrome with our samples and it works fine. So it must have something to do with your code. You will want to compare your code with our samples and see if you can find what triggered the problem.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 12/9/2010 Posts: 28
|
I know this is old, but this article helped me out with the same problem: http://stackoverflow.com/questions/8159321/request-exceeds-the-configured-maxquerystringlength-when-using-authorize It did require setting the maxQueryStringLength and the maxQueryString per http://stackoverflow.com/a/9743176
|
|