Returned File URL exceeds maximum limit in Internet Explorer

Returned File URL exceeds maximum limit in Internet Explorer

seeking27seeking27 Posts: 3Questions: 0Answers: 0
edited February 2014 in TableTools
Hello,

I have a table consisting of 21 columns that correctly renders. I'm using TableTools (love it along with Datatables) to allow the user to save the table as a CSV file. I do this with server side processing. My table tools setup looks like this:

[code]
"oTableTools": {
"aButtons": [
{
"sExtends": "download",
"sButtonText": "Save as CSV",
"sUrl": "/Bucketing/Bucketing/GetDataTableEquityInstrumentsCopy"
}],
[/code].

My GetDataTableEquityInstrumentsCopy method looks like this :

[code]
public ActionResult GetDataTableEquityInstrumentsCopy(jQueryDataTableParamModel param)
{
//takes the data from the param object and returns a file like this:
return File(data.AsCsvByteArray(), "text/csv", "IAD_" + currentModel.VehicleCode + "_" + currentModel.VehicleDate.ToString("yyMMdd", System.Globalization.CultureInfo.InvariantCulture) + ".csv");

}
[/code]

The problem I'm facing is that this works correctly in Chrome and Firefox, but not in IE8. I believe it's becuase the File URL passed back exceeds the limit in IE and thus doesn't render.

Here is the URL that gets sent back from the above method

[code]
http://localhost:59304/Bucketing/Bucketing/GetDataTableEquityInstrumentsCopy?sEcho=1&iColumns=21&sColumns=Country+Code%2CCusip%2FSedol%2CBB+CompanyId%2CShares+Held%2CStatus+Code%2CSecurity+Symbol%2CSecurity+Name%2CPrice+Currency%2CPrice%2CTCAP%2CTCAP+%24%2CFIF%2CFIF+Local%2CMCAP%2CMCAP%24+FF%2CBTM%2CDPB%2CSector%2CSize+Bucket%2CValue+Bucket%2CDPB+Bucket&iDisplayStart=0&iDisplayLength=50&mDataProp_0=0&mDataProp_1=1&mDataProp_2=2&mDataProp_3=3&mDataProp_4=4&mDataProp_5=5&mDataProp_6=6&mDataProp_7=7&mDataProp_8=8&mDataProp_9=9&mDataProp_10=10&mDataProp_11=11&mDataProp_12=12&mDataProp_13=13&mDataProp_14=14&mDataProp_15=15&mDataProp_16=16&mDataProp_17=17&mDataProp_18=18&mDataProp_19=19&mDataProp_20=20&sSearch=&bRegex=false&sSearch_0=&bRegex_0=false&bSearchable_0=true&sSearch_1=&bRegex_1=false&bSearchable_1=true&sSearch_2=&bRegex_2=false&bSearchable_2=true&sSearch_3=&bRegex_3=false&bSearchable_3=true&sSearch_4=&bRegex_4=false&bSearchable_4=true&sSearch_5=&bRegex_5=false&bSearchable_5=true&sSearch_6=&bRegex_6=false&bSearchable_6=true&sSearch_7=&bRegex_7=false&bSearchable_7=true&sSearch_8=&bRegex_8=false&bSearchable_8=true&sSearch_9=&bRegex_9=false&bSearchable_9=true&sSearch_10=&bRegex_10=false&bSearchable_10=true&sSearch_11=&bRegex_11=false&bSearchable_11=true&sSearch_12=&bRegex_12=false&bSearchable_12=true&sSearch_13=&bRegex_13=false&bSearchable_13=true&sSearch_14=&bRegex_14=false&bSearchable_14=true&sSearch_15=&bRegex_15=false&bSearchable_15=true&sSearch_16=&bRegex_16=false&bSearchable_16=true&sSearch_17=&bRegex_17=false&bSearchable_17=true&sSearch_18=&bRegex_18=false&bSearchable_18=true&sSearch_19=&bRegex_19=false&bSearchable_19=true&sSearch_20=&bRegex_20=false&bSearchable_20=true&iSortingCols=1&iSortCol_0=0&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=true&bSortable_4=true&bSortable_5=true&bSortable_6=true&bSortable_7=true&bSortable_8=true&bSortable_9=true&bSortable_10=true&bSortable_11=true&bSortable_12=true&bSortable_13=true&bSortable_14=true&bSortable_15=true&bSortable_16=true&bSortab
[/code]

As you can see it gets truncated in IE (see the '&bSortab' at the end) . Any tips on how I can reduce this URL length? Since I'm just saving to a file I wouldn't think all that meta data is needed (I see it's column metadata that is being sent back for datatables.

Thanks in advance!

Charlie

Replies

  • allanallan Posts: 55,855Questions: 1Answers: 8,825 Site admin
    Can you not just use POST and side set the problem entirely?

    Allan
  • seeking27seeking27 Posts: 3Questions: 0Answers: 0
    Thanks for the reply Allan. I could do a post. I do have
    [code]
    "sServerMethod": "POST",
    [/code]

    set but I take it that isn't for the tabletools button server side call. Is there something similar I need to set to get that to do a POST?
  • seeking27seeking27 Posts: 3Questions: 0Answers: 0
    Resolved thanks! FYI, to get the table tools button to do a POST, I found how to do this here:

    https://datatables.net/extras/tabletools/plug-ins

    Specifically the 'download (POST + GET)' section.

    - Charlie
This discussion has been closed.