Sending Zip File To Client Via Response?

Oct 26, 2010

I've been pulling my hair out about this for ages. I have a WebService which sends a zip file to the browser. This works; when I test the WebService and 'invoke' the method through it directly, the zip file is downloaded to the browser correctly.

The problem arises when I use jQuery to send an AJAX request to the WebService - the zip file is downloaded to the response, but it stays in the response and doesn't download as a file.

Here is my code:

[Code]....

Now this works since the file downloads when I use the 'invoke' function when navigating directly to the service.

Here is my jQuery AJAX request...

[Code]....

I added the code in 'beforeSend' so that the request states explicitly what type of response the browser should expect.

I've been using Firebug to monitor the request/response headers and can't see anything wrong with them (except when I look at the content of the response, it's full of binary data AND its the same size as the file I'm sending.

I just attempted to upload screen-dumps of the request/response headers and the content of the reponse but I don't have enough reputation points to do this yet :-(

The Response is the same size of the Zip file so I'm assuming its being sent back to the browser, but the browser doesn't know what to do with it.

Tested in IE, FF & Chrome and the results are consistent.

View 2 Replies


Similar Messages:

Save Pdf File In Client's Computer For Sending Email Attachment

Sep 22, 2010

The subject of this thread is my question and I am really very sorry, I cannot brief it. I have generated the pdf file which contains text taken as input by various web-form and have saved it in my local drive then sended it to some email addresses. Now I want to know that how can I save it in client computer and send it to some email addresses provided by Client on demand? I am failed to solve this problem as I don't know how to get INFORMATION OF CLIENT'S LOCAL DRIVE AS CLIENT MAY USES DIFFERENT OPERATING SYSTEM.

View 25 Replies

Response.BinaryWrite - Incorrect Name Of File Opened On A Client Side

Jan 24, 2011

[Code]....

The dilaogbox that offers me to save the file shows incorrect chars if documentFileName has name not in ASCII format. What I'm supposed to do to have the file name displayed correctly in this dialogbox and to have this file opened under the same name in MS Word, Excel whatever else?

View 5 Replies

AJAX :: How To Upload A File From Server To Client Without Attaching It To The Response

Mar 22, 2011

Basically I have to generate a rather large XPS document serverside and send this back to the client.

The issue I have whilst trying to do this is because the XPS document needs to be created on a STA thread, so either the response is sent back before the async operation is complete (in which case I can't attach the file using the transferfile method) OR I have to wait until the Async thread has completed and then I can send the file using the transferfile method (but this leaves the current page locked out for quite a while).

View 5 Replies

Web Forms :: Client Download .csv File From Server Using Response.TransmitFile?

Sep 3, 2010

I am using the code below to enable clients to download a .csv file from my server.

The problem I am having is that when the file is saved to the client computer the file name is prefixed and suffixed with an underscore which leads to a file type of .csv_ which is obviously not a recognised file type.

How can I strip the underscores from the file name at the transmit stage?

Dim FileName As String = LstBox1.SelectedItem.ToString
Dim FilePath As String = "~/temp" & FileName
Response.Clear()
Response.ContentType = "text/csv"
Response.AddHeader("Content-Disposition", "attachment; filename=" & FileName & "")
Response.TransmitFile(FilePath)
Response.End()

View 9 Replies

Sending OK Response Over HTTP To Webpage Request

May 12, 2010

I am using an SMS Gateway to make my application receive SMSs. For this, the SMS Gateway sends a request to one of the pages in my application with the message as a querystring parameter. eg.[URL]. Now after my page gets invoked, I need to send an OK response to the SMS Gateway so that it doesn't keep retrying to send the same message to my application again and again. I cannot figure out how to send the OK response.

View 1 Replies

Does Response.Redirect Equate To Sending A GET Request To The Server

Jan 5, 2010

Does Response.Redirect equate to sending a GET request to the server?

View 3 Replies

Web Forms :: Sending Email Using MD5 Challenge-Response Authentication?

Oct 13, 2010

Im trying to send email using MD5 Challenge Response, but it is not working with me, heres the code i am trying:

[Code]....

This is the error Im getting: System.IO.IOException: Unable to read data from the transport connection:

[Code]....

View 3 Replies

Sending HTTP 200 Response Back To A Gateway After Successful Delivering Of Message?

Mar 26, 2011

I have an application that interact with a SMS gateway and after successful delivery of message to my application i will like to acknowledge them by sending HTTP 200 Response to the Gateway, how can I do that suing asp.net. I am thinking of using Response Headers parameter to do that.

View 3 Replies

Push - Sending Data Between Client With 4.0?

Feb 21, 2011

I'm transforming lotus note application to ASP.NET.In lotus note, we can pass the application(data) from staff to his/her manager for approval.The staff can also check status of his/her data whether the manager is opening it, approved it or not.This process can be done in real time. I mean on the staff screen he/she will see status is changing from data sent --> manager is opening --> manager accepted or manager rejected it.In the same time, if other staffs try to track this application(data) they will see the same screen with the first staff.ow, in asp.net, i'm thinking of sending data from staff to manager directly. I don't want manager's web browser need to do polling for every xx millisecond. I'm not quite too sure it can be done or not in asp.net because i'm not the WEB guy.After doing a research for a while, i found that comet may help me on that but it seems pretty hard. And I don't know it is suitable for my problem or not or someone may guide me a better idea on this.

View 1 Replies

C# - Page Not Rendered When Sending Statuscode 500 To The Client

Jul 20, 2010

I have a page (generic handler) on which I want to return the status code 500 to the client to indicate that something is wrong. I do it like this:

Response.StatusCode = 500;
Response.StatusDescription = "Internal Server Error";

And at the same time I render a friendly message telling the user that something went wrong. But instead of seing my message, I get the default IIS message saying something like this:

Server Error
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.

And if I go in to IIS and remove the error page for 500, I get this message:

The page cannot be displayed because an internal server error has occurred.

It works as intended in IIS6, but not in IIS7. What should I do to get it working in IIS7?

View 1 Replies

Sending CSV Created On The Fly Back To Client For Download?

Mar 11, 2011

I'm converting a bunch of FOXPRO / FOXWEB apps to ASP.NET.

The underlying DB is still foxpro (for the moment).

I am passing a table to some VB.NET code that I want to have converted to a CSV file and sent back to the client for download. And it works! Sort of ... It works sometimes, but at other times, instead of asking me if I want to download the CSV file, it just spews the file to the browser window.

On the asp side, I am passing the response object, the table and the csv file name.

[Code]....

View 3 Replies

JQuery :: Sending Data To The Client ( Advice )?

Nov 2, 2010

Currently, I am exploring options for sending data to the client. What I am hoping for is suggestions, or a pros and cons feedback.

What I am wanting to do is query the database then send this data to a web service ( or maybe wcf ). Once there, jquery ( or another JS library ) will utilize this data to fill a grid/tree/form depending. This all seems very very basic, but what concerns me is the amount of data that can be sent. I have seen some grids that have 16K records...and what worries me is that would be WAY too much data to send.

I was just wondering how these things are handled. My current thoughts are to do a 'onDemand' loading, but my inexperience has me second guessing. Also, I know this isn't directly related to jquery, but I notice there are a lot more examples with wcf rather than webmethod/web services.Is wcf better for these types of things?

View 5 Replies

Web Forms :: Smtp Client Is Not Sending Some Emails?

Feb 1, 2011

I use a Smtp Client to email submitted information from an asp.net form. 3 users sent in their information and the user on the other end did not recieve either one of the emails. On the 2nd time around, she did recieve the emails. What could it be?

[Code]....

View 27 Replies

Web Forms :: Sending Data From Client To Server Via Internet?

Jul 15, 2010

i have a website in our office which is a School. the website is an enrollment website which is available view internet, where the users (students) access the website to enroll almost simultaneously, select their subjects and schedules, etc.

this website is developed by someone who is no longger employed here. regular problem of the website is in times of enrollment, the students is experiencing slow processing when ever thay try to view/edit their information, subjects, etc. which are all in the database. a proposal was made and we have agreed to develop a new system that should run faster than the old system. access sql database to do Select/Update/Insert in the fastest way possible.

View 6 Replies

C# - Sending Client Certificate Though HttpWebRequest, Intermittenly Working?

Oct 7, 2010

I have created a web application that calls a web service that requires a Client Certificate for authentication. Here is a snippet of how I am building the request:

// Grab Certificate
X509Certificate2 cert2 = new X509Certificate2(AppDomain.CurrentDomain.BaseDirectory + GiftCardConfig.A2A_CertificateLocation, GiftCardConfig.A2A_CertificatePassword, X509KeyStorageFlags.MachineKeySet);[code]....

This all works, but only intermittenly. About every 24 hours the Server hosting the web service returns a 403:Forbidden error. The only way to fix it is to do a iisreset of the server running the web application. We are completely stumped about this issue and would like to know if this issue has something to do with the web application or the configuration of the server it is being hosted on.

View 1 Replies

Web Forms :: Sending Email To Client On Button Click

Mar 30, 2012

I am sending the email to client on button click.

I am sending link with code

mm.Body =

To activate your account Please visit the link [URL]

View 1 Replies

IIS Response Not Reaching Back To Client

Oct 12, 2010

I got a strange issue after hosting the my site in IIS 7.5, Windows server 2008 64 bit

The applicaion is created in ASP.Net 2.0

The page with issue has following workflow:

Upload a file from browser (may be very large size ~50 MB)Perform some process (May take very long time: up to 30 minuits)Notifies the client that process is done.During the process client uses something like http://www.codeproject.com/KB/session/Session_Defibrillator.aspx to keep the session alive.

The Issue:
The client does not get any response sent by my code after the process is over. It should refresh the page with the response provided by my code. But instead it only shows waiting for... in the status bar.

I have tried this on IE and firefox.

To veryfy the process is over

I have added some trance message in my code to check when the process gets finished.I have also checked the Log from IIS, it also shows that response sent with Code 200.

Please help me solving this issue:

What could be the issue?How can I diagnose and fix this problem?In what cases connection between browser and IIS server gets lost.

View 1 Replies

MVC :: Manipulate Response Before Send To The Client?

Jul 23, 2010

I create my own litte ViewEngine, done many things that works great, but now I want something to implement, but I don't know how.

I want the final Response Content when the controller is executed and the view is executed, manuelly manipulate and than send to the client.

I have two Examples for it.

First I have an AssetManager, he collects all Css files and JavaScript files, given by components, the view, classes and so on.

And this collected links I will insert with String.indexOf before the "</head" tag.

The reason why I want do this in the engine and not with a line like this in the head part

[Code]....

Is that I want so save me the work to do this every time on each project in the master page and maybe in single views.

A second usefull idea is, I want to write my own litte trace component, and I want so write the generated content before the "</html>" tag.

where I can manipulate the content before sending it to the client, and this in the engine?

View 3 Replies

Create Email Message And Send To Client For Review Before Sending?

Sep 23, 2010

I am looking for a means by which ASP.NET can create an Outlook MailItem and stream it to the client machine for the user to review prior to sending. I know that its possible to create files such as Word docs and Excel spreadsheets an then stream them, but I don't know how to do it with ASP.NET.

View 6 Replies

HttpHandlers / Modules :: Sending Binary Data From Server To Client?

Oct 29, 2010

I want to send a file by converting it into binary file to the client end and then it should be read by javascript which again I am passing to the OCX method.(like my OCX method accept only the binary data so i have to transmit binary data from server side to client).

View 1 Replies

AJAX :: Sending Complex Objects From JavaScript (client) To C# (server)?

Mar 26, 2010

I have this object in my server side:

[Code]....

Now I do this on the client side, to send a typed object to the server:

[Code]....

and actually it works. The problem is that I cannot find the way to stablish this property: "public ThingDetails[] details;"

View 7 Replies

Msword - Sending A Dotx(word Template) To Client Side?

Nov 11, 2010

In my program, I need to send a dotx to client side. Now I process it as:

generate the temp dotx in server side which contains some data from database.
send it to client side. The code is:

Response.Clear();
Response.Buffer = true;
Response.Charset = "unicode";
Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.template";
Response.AddHeader("content-disposition", "attachment; filename=**.dotx");
Response.AddHeader("Content-Length", dataWord.Length.ToString());
Response.ContentEncoding = System.Text.Encoding.Unicode;
Response.BinaryWrite(dataWord);
Response.Flush();
Response.Close();

dataWord is the dotx. delete the temp dotx.

This process should be correct. But sometimes I only get a blank document in client side. I am sure the dotx generated in server side is not blank. What may cause that problem? Does error happen during sending data to client-side with Response, or is my code not good?

View 2 Replies

C# - Sending ICalendar Event To Client While Still Continue Running Code?

Oct 26, 2010

I have built a basic calendar event using DDay.iCal, when I click "Add to calendar" link I produce an event and then sends this to the client.Basically, my application works like this.

A User logs in.
Selects a specific date.
Books a specific timeslot
Clicks the "Add to calendar" link

Sending the event is done by using Response.Write() which sends the following to the client:

Response.ContentType = "text/calendar";
Response.AddHeader("Content-disposition", "attachment; filename=appointment.ics");
Response.Write(iCalString);

The above works fins but it requires me to first book the event then manually and then click the "Add to calendar" link.I want to merge the steps 3 and 4. But when trying to do so the event booking gets saved to the database but the screen does not get refreshed.Is there a "simple" way to get around this?

View 2 Replies

Configuration :: SMTP Client Fails When Sending Email With GoDaddy?

Jul 31, 2010

I've written a simple webservice and am running it locally to test it out. Right now, my settings are as follows:

From [URL]

Settings When Hosted Externally

<system.net>
<mailSettings>
<smtp from="noreply@domain.net">
<network host="smtpout.secureserver.net" password="<password>" port="25" userName="noreply@domain.net"/>
</smtp>
</mailSettings>
</system.net>

I've tried these settings, and also tried explicitly setting the properties of my SmtpClient object @ run-time. On send, I receive the following exception

"Failure sending mail. Unable to connect to the remote server - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 64.202.165.58:25"

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved