AJAX :: Downloading A File And Updateprogress?
Apr 22, 2010
I have an export to excel functionality on my web application. WHen the user clicks the "Export to Excel" button, the file is created and it will ask the user to open it or save it to their local machine.
Since the file creation process takes a long time, I added the ajax update progress control. SO now, as soon as the user clicks the "Export to Excel" button, the progress bar image shows up, but after the file is created, I get the following error.
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.
I know that, if we use Response.write in the code behind, we get this error. But I have to use Response.Write because I am presenting the user with a prompt to save or open the newly created file. Is there any other way to do this?
The following is the aspx code.
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
[Code]....
View 8 Replies
Similar Messages:
Jan 24, 2011
I'm trying to use below simple code for ajax postback. With file upload, neither javascript the "function startRequest" ever triggers, the file control shows null value somemore.Earlier I had Update progress which didn't work with file upload ever so I removed it. Now I just want to disable the button as the file is uploaded and its inputs are processed in the background. Once the response comes back, the "submit" button is re-enabled.But the file-upload with Updatepanel doesn't work at all. What am I doing wrong,
[Code]....
[Code]....
View 1 Replies
May 2, 2010
I have a webform that works the following way:
1. Button_openPanel will display panel Step2Panel through ModalPopupExtenderStep2.
2. Button_runThread (inside Step2Panel) will close Step2Panel and will then run a lengthy process server-side. This lengthy server-side process will cause the UpdateProgress control to be displayed.
Similar to the ModalPopup, I want to disable the whole page while the UpdateProgress control (with its animation gif) is running. Currently, the UpdateProgress is displayed, but I can click Button_openPanel (or anything else) which will cause the application to break.
Is this possible?
This is basically all the code. I stripped anything that was unneeded:
[Code]....
The code-behind is basically this:
[Code]....
Everything's working pretty good now, but I need to disable everything while the time-consuming process is running and UpdateProgress is displayed.
I was thinking of displaying the UpdateProgress control as a a sort of ModalPopup, but I'm not sure if it's possible. If not, then the alternative would be to disable Button_openPanel while the time-consuming process is running and UpdateProgress is displayed.
View 2 Replies
Jul 4, 2013
I have a wep page. Its consists of some controls along fileupload controls. My page Fully placed into UpdatePanel. when i press the submit all contols values and file upload file should be stored into back end.i used vs2008 framework 3.5.
Note: for fileUploading perpose i should write trigger with postback on submit button.while processing the submit button action i want to show some processing (progressing) controls like round rotation like..shall i place on ajax toolkit 4.0 instead of 3.5.
View 1 Replies
Jun 16, 2015
I used updateProgress for Downloading File on button click.
it works but when downloading Completes, progress bar did not disappears.
View 1 Replies
Feb 8, 2011
Is it possible to download a file and set its Date Modified attribute by means of Ajax? I tried to use server-side code below but couldn't set Date Modified although I explicitly used "Last-Modified" Response header:
try{
Response.Clear();
Response.AppendHeader("Content-Disposition", "attachment; filename="+l_attchmntFileSpec);
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Last-Modified", "Tue, 15 Nov 2010 12:45:26 GMT");
Response.BinaryWrite(l_attchmntToDownload);
Response.End();
}
catch (Exception Ex)
{ ...
}
Note: The file in question is stored in my database. It is represented by byte array l_attchmntToDownload.
View 1 Replies
Jan 14, 2013
I have made an application where I am displaying the .pdf , .doc , .docx files. These files are uploading from an Admin Panel.When user place a mouse pointer on download icon provided in front of every file, it shows the complete path where it’s get saved.I want to avoid this path visibility even when user place mouse on download icon and even if it Inspect an element (as most modern browser will have this functionality).
View 1 Replies
Apr 21, 2010
we are working on a file download page. We want to download a file with a name with spaces and accents. Although the filename is shown correctly on the filedownload dialog, when we click open, the file name is shown with %e1%ba%a3n%20... on notepad. ('Save as' shows the correct name) This problem only happens in Internet Explorer.
Is there anyway we can Display the file name correctly (on the target application) after opening it (without saving) from file download dialog ?
We use this code to set the filename :
fileName = Server.UrlPathEncode(fileName);
Response.AppendHeader("Content-Disposition", "attachment; filename="" + fileName + """);
View 6 Replies
Nov 23, 2010
My requirement is client has to download files which were uploaded by employees. But if the file name contains a space, Mozilla Firefox use only the name up to the first white space and remaining name is truncated. Is it issue with mozilla firefox? if so how can i get rid of this. Important thing is in IE its working well.
View 2 Replies
Feb 1, 2010
I am working on a http based (NOT Secure) Web Application. In this, I have provided a provision to add some appointment to the Client's outlook calendar. I am creating the .vcs file dynamically when clicked on a hyperlink. The code of generating .VCS file is:
string calendarFormat = GetVCSFormat();
Response.ContentType = "text/calendar";
Response.AppendHeader("content-disposition", "attachment; filename=MyCalendar.vcs");
Response.Write(calendarFormat);
Response.End();
It is working fine in all browsers except IE. It is giving me following error:Internet Explorer cannot download GenerateAppointment.aspx from server. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found.
View 1 Replies
Sep 10, 2010
I have a link button which the user clicks on it and will download a .PDF file into their PC.It is just a file for them to download.
Currently, I have the following code.
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment;filename=Savings Account eStatement.pdf")
Response.Charset = ""
Response.ContentType = "application/vnd.pdf"
Dim objSw As New StreamWriter("Savings Account eStatement.pdf")
objSw.Close()
lblMsg.Text = "Your file created successfully"
lblMsg.ForeColor = Color.Green
'Response.Output.Write(sw.ToString())
Response.Flush()
Response.End()
' Download the file
Response.Redirect("~/Savings Account eStatement.pdf")
Response.Flush()
Response.End()
View 3 Replies
Aug 10, 2010
i am making a gridview in which textfield of password should match with the password stored in the database (table) .As soon as that happens, the file should be ready to download . now the problem is that the code is niether working nor showing any error, which is very sarcastic.
if (txtval.Text != null || txtval.Text !="")
{
if (txtval.Text == ds.Tables[0].Rows[0]["FilePassword"].ToString())
{
lblmessage.Text = "File has been downloaded successfully.";
WebClient fileReader = new WebClient();..........
View 2 Replies
Jul 15, 2010
I'm trying to write come code for users to download files, but the files are located above the webroot (e.g. c:downloads)
I've found some code online that allows me to download a file via a url parameter/argument which is perfect, but the files need to be located within the website structure.
<%@ Page language="vb" runat="server" explicit="true" strict="true" %><script language="vb" runat="server">Sub Page_Load(Sender As Object, E As EventArgs)Dim strRequest As String = Request.QueryString("file") '-- if something was passed to the file querystringIf strRequest <> "" Then 'get absolute path of the fileDim path As String = Server.MapPath(strRequest) 'get file object as FileInfoDim file As System.IO.FileInfo = New System.IO.FileInfo(path) '-- if the file exists on the serverIf file.Exists Then 'set appropriate headersResponse.Clear()Response.AddHeader("Content-Disposition", "attachment; filename=" & file.Name)Response.AddHeader("Content-Length", file.Length.ToString())Response.ContentType = "application/octet-stream"Response.WriteFile(file.FullName)Response.End 'if file does not existElseResponse.Write("This file does not exist.")End If 'nothing in the URL as HTTP GETElseResponse.Write("Please provide a file to download.")End IfEnd Sub</script>
Source: http://www.xefteri.com/articles/show.cfm?id=8
how this can be modified so that it can access files outside the webroot?
I'd like it so that I can create an href like: <a href="download.aspx?file=test.pdf">Download File</a> and then the code will download the file from c:downloads est.pdf
View 2 Replies
Jul 2, 2010
how to use <iFrame> tag in <UpdateProgress>. I want my whole screen in opacity when i press a button like the screenshot below. I tried in this way
[Code]....
View 3 Replies
Mar 26, 2010
I have VB code that parses XML data from a webpage. Up until 2 days ago the XML data could be viewed right on the page and I could just grab the HTML source code to get the information. Now they have changed the page to a link button to download the XML file.
The problem is that when I click on the XML link I get the 'File Download Prompt' which asks me to run or save the file. I figured I could just save the file to temp directory and then open it up to parse it in my VB app but I can't figure out how to grab the file from the browser in my application.
View 2 Replies
Feb 8, 2011
I am trying to find a way to prevent a PDF from being printed or downloaded when view from web. Also, it is prefered that user cannot Print screen.
According to the required futures, it will cose a lot to create a desktop application from scratch.
I am thinking about converting those PDF files to Flash.
View 5 Replies
Mar 9, 2011
I have 4 checkboxes named(Laptop, Car, Phone, TV) and a button. when user checks one Car checkbox and clicks a button, car specifications pdf should be downloaded. Similarly when phone or laptop checkbox checked, relevant pdf's should be downloaded. For this i have written following code
[Code]....
This code is working well in VS2008 but has issues when run in localhost.
Issue --> Check one checkbox like chkPhone and click on button, the Phone pdf gets downloaded and uncheck chkPhone checkbox and check other one like chkCar and when clicked on button to download, getting following errors.
1. xml parsing error not well-formed --> this error is getting only in mozilla.
2. HTTP/1.1 100 Continue Server: Microsoft-IIS/5.1 Date: Wed, 09 Mar 2011 05:34:23 GMT X-Powered-By: ASP.NET HTTP/1.1 200 OK Server: Microsoft-IIS/5.1 Date: Wed, 09 Mar 2011 05:34:23 GMT X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Content-disposition: attachment; filename=Car.pdf;
I have googled the issues and find the following sites[URL] For second issue i added the following line
System.Net.ServicePointManager.Expect100Continue = false;
but still sometimes iam getting the same error. Sometimes these errors raise after downloading 2 files and when tried to download 3rd one.
View 4 Replies
May 13, 2010
I wrote download excel file in my code. If I click download button I need show ajax-load image (pnlPopup panel). But it is not displaying. I think because of Some "Response" statements (see below code). Download working fine, but simultaniously I want show loader panel too.
<asp:Panel ID="pnlPopup" runat="server" visible="false">
<div align="center" style="margin-top: 13px;">
<asp:Image runat ="server" ID="imgDownload" src="Images/ajax-loader.gif" alt="" /> <br />
<span class="updateProgressMessage">downloading ...</span>
[Code]....
View 2 Replies
May 2, 2012
I'm downloading a file from my intranet site and on Chrome, it works as expected. But when I try it on IE, it crashes.
ASP.NET Code:
<a href="../nbd.exe">TEST</a></h2>
Is there something I need to do just for IE?
Also, it works fine in Opera and Firefox. So just IE...
View 1 Replies
Aug 7, 2010
I have put a updateprogress ajax nested in a gridview template. However, when I click a button inside the gridview row, all of the rows in the gridview display the updateprogress gif at the same time. When the user click a button on one row, how can I get the updateprogress to display itself only on that row index?
here is my code:
<itemtemplate>
<asp:Label
ID="lblPriceQty"
runat="server"></asp:Label>
<div>........
View 1 Replies
Aug 13, 2010
Normally I google search to try and solve my issues but in this case I have no idea what is wrong. I'm trying to get an UpdateProgress to show some text while the panel is updating, but it just doesn't show up. I'm not seeing any visible errors and nothing seems to be rendering incorrectly other than the text just not displaying on the update. Here is a look at my code:
[Code]....
I know it has to be some really simple that I am just overlooking but I am stumped.
View 4 Replies
Apr 19, 2010
Here is the code I'm using:
[Code]....
Works great on localhost. But when I upload it to the server with IIS6.it works 25% of the time. the other times, I just get an empty (0 bytes) file to download.
View 1 Replies
Aug 10, 2010
i have designed an c#.net application in which i am uploading the files and saving them into a directory.
now i want to download them.
i had wrote a code to download files,its neither giving any result nor error.
the code is as :
[code]....
View 3 Replies
Jun 29, 2010
i got following error when downloading ZIP file having size 4GB the error says
The size parameter must be between zero and the maximum Int32 value.
Parameter name: size
Actual value was 2166897372.
View 2 Replies
Nov 18, 2010
I want to know two things about ASP.NET MVC2 that I've researched from Google but still confusing. Hope I can find clear and clean answer here.
First, how to upload a file to server with custom file path. (Eg. to /Content/Files)
Second, how to download that file, since the url has applied URL Rounting, how to map to them?
View 1 Replies