Click here to Skip to main content
15,877,675 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
So i have 2 ASP.NET MVC web apps running.
The first one takes in data and sends it to the second one.
The second App takes the data and builds a PDF then returns the PDF.

This was working well using a simple
@Html.actionlink("URL", "Download File", new { a = Model.a, b = Model.b, c = Model.c}, New{target = "_blank"})

But then i started to use longer data to simulate the actual data and i am having trouble with IE's URL length limitation.

Is there any way to get this data to the second app using a post method form in order to make use of the request body rather than the URL bar, and if so how would i do this?

What I have tried:

like i said above a simple action link something like
@Html.actionlink("URL", "Download File", new { a = Model.a, b = Model.b, c = Model.c}, New{target = "_blank"})

this works well on other browsers but unfortunately IE limits the size of the URL and my data is too long for it.

I also tried using an AJAX POST to send the data which works great until you learn that you cant do anything with the returned PDF. (i thought maybe i could post it to a new window as the HTML and it would catch the file header and prompt a Download but nope :(... )

any help would be greatly appreciated
Updated 21-Oct-16 11:41am

1 solution

Ended up building a form with submit action:url of 2nd app, method:post putting hidden editor inputs for the longass strings and btn for submitting the form. Since the second site is trying to return only a file the browser doesn't try to redirect to a page from it and yay. If anyone has any better ideas i would be glad to hear them
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900