I'm using jQuery to build an IFRAME and pass some hidden input values to a Download.aspx page - jQuery code looks like this
The inputs variable looks like thisCode:$('<form action="'+ url +'" method="'+ (method||'post') + '" target="iframeX">'+inputs+'</form>') .appendTo('body').submit().remove();
<input type="hidden" name="filename" value="mit-license.txt" />
And the top of the Download.aspx code behind looks like this
I could not find the INPUT value - where does it pass in? I checked the "sender" and the ctx objects and could not find it...Code:Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim ctx As HttpContext = HttpContext.Current Dim response As HttpResponse = ctx.Response Dim sFile As String = "mit-license.txt" ' Request.QueryString("filename").ToString ' Buffer to read 10K bytes in chunk: Dim buffer(10000) As Byte ' Length of the file: Dim length As Integer ' Total bytes to read: Dim dataToRead As Long ' Identify the file to download including its path. Dim filepath As String = "D:\ACS Desktop\AWC\" + sFile
I hardwired the mit-license.txt filename to prove that the download works...




Reply With Quote