Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4533434
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:09:20+00:00 2026-05-21T14:09:20+00:00

I have a jqGrid that uses Post to send the request. I have a

  • 0

I have a jqGrid that uses Post to send the request. I have a php function that when given the jqGrid search and sort settings can return a CSV file. And, I have put together an external button that can call exportExcel in an attempt to call that php function and retrieve the CSV.

The problem is, excelExport is using GET to send the data, and I still need it to be POST. I looked at the code and tried a few ways to set excelExport to send its request via POST with no luck.

So, the question is: Is there a way to get excelExport to use POST, or is there an easy way for me to send the exact same POST request that the grid would send if I were reloading it to my php function that can generate the CSV?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T14:09:21+00:00Added an answer on May 21, 2026 at 2:09 pm

    It seems to me that what you want is not possible. I have to explain more detailed what I mean.

    It is not a problem to get the CSV, XLS or XLSX file contain per HTTP POST. The problem is to show the server response in Excel if you will use HTTP POST.

    The code of excelExport method is very simple you can see it here. What excelExport do is just open an URL where some additional parameters will be added. The main part of the code is following

    window.location = url;
    

    So all real interesting things are implemented on the server. It is important that the server set some HTTP headers, especially Content-Type, which define the HTTP response as Excel file (or as CSV if you can’t generate XLSX data). I personally use Open XML SDK 2.0 to generate XLSX file contain and set "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" as the Content-Type. In your case it should be "text/csv" (see here). Additionally one can use Content-Disposition HTTP header to define the preferred filename of the response. For example, it can be "attachment; filename=test.csv" in your case. Because you has already the server code you have probably all the things implemented in the code.

    The most important part is: web browser knows how to open different URL contains. If it open new url (per HTTP GET !!!) it will use the corresponding application like Excel to show it.

    On the other side if you use $.ajax you can get the CSV contain per HTTP POST, but how you want to solve the next problem – to start Excel with the data? I don’t know the simple solution without the usage of ActiveX controls working in Internet Explorer only.

    So I recommend you just use HTTP GET. If you don’t want caching of data you can do this by setting the corresponding HTTP headers. Setting of Cache-Control: max-age=0 is enough in the most cases. Setting Cache-Control: private additionally switch off caching the data on the proxy and declare that the data could be cached, but not shared with another users. More information about the subject you can find in the following Caching Tutorial.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way in jqgrid to have an editable column that uses a
Can anyone please tell me the XML structure for sub-items that jqgrid uses. I've
We have a jqGrid that shows the search box above the grid at all
I have a JSF application that uses mostly Richfaces. I would like to introduce
I have a JqGrid that a i want to populate with Json data that
I have a jqgrid that's functionning very well. I was wondering is it possible
I have a JSON file that must be formatted as follows. How can I
Have a n-tire web application and search often times out after 30 secs. How
I have been working with jqGrid and am a bit stumped as to why
I have a jQuery selector that queries elements by tag name and class. In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.