download (POST + GET) Request-URI Too Long

download (POST + GET) Request-URI Too Long

seotechseotech Posts: 8Questions: 4Answers: 0

Hello all,
currently I'm searching for a solution to get the same result with the download plugin (POST + GET) as i got with the download (GET only) Plugin from your Site. The problem is that my table has many columns and because of that the URL request is too long for a get request with all the params.

How can i make a POST instead of GET request with the params ( "this.s.dt.oApi._fnAjaxParameters( this.s.dt )" ), because the second example plugin POST + GET, post only custom params.

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 57,236Questions: 1Answers: 9,113 Site admin
    edited January 2015

    because the second example plugin POST + GET, post only custom params.

    It looks like the POST version of the plug-in isn't using the oParams options that it created. What you could do is loop over that array and add the values to the form in exactly the same way the aoPost array is used.

    Possibly a better option would be to use only oParams and loop over that. Add the custom parameters to that array...

    I'll update the site with that change shortly.

    Allan

  • seotechseotech Posts: 8Questions: 4Answers: 0

    Thanks for the answer.

    do you have an code example for the loop. For my Excel Export funktion i need the same request structure as GET, because of current column filter strings etc.

    I tried to build a loop , but I have problems implementing the Operating in Javascript.

  • allanallan Posts: 57,236Questions: 1Answers: 9,113 Site admin

    Sorry for the delay in replying - I've updated the plug-in now.

    Allan

  • seotechseotech Posts: 8Questions: 4Answers: 0

    Hey Allan,
    i tried your example, but it doesnt work. I got an error in line 22 "aoPost.push is not a function".

    If i understand it correctly the variable "aoPost" is an object and cant be pushed?
    Also the loop create input fields with an "name" and "value" attribute from the object "aoPost". But the "aoPost" isn't a simple "name/value" collection. That can't work right?

  • allanallan Posts: 57,236Questions: 1Answers: 9,113 Site admin

    Urgh - it doesn't quite work with the new style 1.10 Ajax options. I'll need to find time to update it. Basically aoPost is an object and it needs to loop over that object.

    Allan

  • allanallan Posts: 57,236Questions: 1Answers: 9,113 Site admin
    Answer ✓

    I've just completely rewritten the plug-in. The same plug-in now provides support for both get and post.

    Hopefully that will help!

    Allan

  • seotechseotech Posts: 8Questions: 4Answers: 0
    edited January 2015

    Many thanks for your help!

    The plugin works now but only after an short change of the iframe generation.
    At line 30 of your source i got an error like "undefined iframe[0]" (testet in Firefox and Chrome), maybe because of other source code.

    I revert the iframe generation to your previous solution and it works:

    nIFrame = document.createElement('iframe');
    nIFrame.setAttribute( 'id', 'RemotingIFrame' );
    nIFrame.style.border='0px';
    nIFrame.style.width='0px';
    nIFrame.style.height='0px';
         
    document.body.appendChild( nIFrame );
    var nContentWindow = nIFrame.contentWindow;
    nContentWindow.document.open();
    nContentWindow.document.close();
    
  • allanallan Posts: 57,236Questions: 1Answers: 9,113 Site admin
    Answer ✓

    Hmm - interesting. I'm not seeing that error myself. I'll look into it a bit more.

    Allan

This discussion has been closed.