473,513 Members | 3,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is this possible?

Firstly sorry for cross posting but not really sure which group this belongs
in?

Anyway, I have a webapp that basically consists of 2 screens, search critera
& results

I want to be able to provide a way for the user to download a zipped up
excel file of the results.

I can quite easily create a excel file using POI & zip it up using
java.util.zip which creates a zip file on the server. Then add a link to
this file on the results page which when clicked will produce the standard
download dialog box & alls well.

The problem is I have to create the zip file every time the results
generated & displayed but some users might not want this faclity!

Is it possible to have a button/link etc... that when clicked create's the
zip file & produces the download dialog box WITHOUT changing the results
page?

Any ideas?

thanks

harry
Jul 20 '05 #1
2 4106


Harry wrote:
Firstly sorry for cross posting but not really sure which group this belongs
in?

Anyway, I have a webapp that basically consists of 2 screens, search critera
& results

I want to be able to provide a way for the user to download a zipped up
excel file of the results.

I can quite easily create a excel file using POI & zip it up using
java.util.zip which creates a zip file on the server. Then add a link to
this file on the results page which when clicked will produce the standard
download dialog box & alls well.

The problem is I have to create the zip file every time the results
generated & displayed but some users might not want this faclity!

Is it possible to have a button/link etc... that when clicked create's the
zip file & produces the download dialog box WITHOUT changing the results
page?

Any ideas?


Assuming you are working with Servlets or JSP on the server you need to
find out how to set a HTTP response header with them and set a headers alike
Content-Type: application/octet-stream
Content-disposition: attachement; filename=whatever.zip
and then stream the zip to the browser
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
yes

simply have the download URL pointing to a servlet (or whatever server side
technology you are using)

in the servlet build the zip file, set the content-type to
application/x-zip-compressed and write out the zip data as the HTTP body.

note that you with java.util.zip, you can simply open up a zipOutputStream
on the response's output stream so you don't need to save it to a file at
all.

I would also suggest the url ends in .zip as well. Sometimes IE seems to
look at the file extension of the URL as well as the content type

Andy

"Harry" <a@abc.com> wrote in message
news:WW*********************@news-text.cableinet.net...
Firstly sorry for cross posting but not really sure which group this belongs in?

Anyway, I have a webapp that basically consists of 2 screens, search critera & results

I want to be able to provide a way for the user to download a zipped up
excel file of the results.

I can quite easily create a excel file using POI & zip it up using
java.util.zip which creates a zip file on the server. Then add a link to
this file on the results page which when clicked will produce the standard
download dialog box & alls well.

The problem is I have to create the zip file every time the results
generated & displayed but some users might not want this faclity!

Is it possible to have a button/link etc... that when clicked create's the
zip file & produces the download dialog box WITHOUT changing the results
page?

Any ideas?

thanks

harry

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
14461
by: Julia Briggs | last post by:
I am struggling to create a PHP function that would take a specified image (JPG, GIF or PNG) from a link, and resize it down to a thumbnail so it will always fit in a 200x250 space. I am hoping not to have it inserted or read from a database to do this function. Can it be done & someone please help me?
36
9431
by: rbt | last post by:
Say I have a list that has 3 letters in it: I want to print all the possible 4 digit combinations of those 3 letters: 4^3 = 64 aaaa
20
2439
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to the site, and then i have to select the file to upload.. i used sendkeys.. and i worked perfect.. BUT ... the computer must be locked for security (...
7
2336
by: Andrzej | last post by:
Is it possible to call a function which name is given by a string? Let assume that I created a program which call some functions for example void f1(void), void f2(void), void f3(void). After some time, I added new function void f4(void).
2
3786
by: Bhupesh Naik | last post by:
This is a query regarding my problem to make a spell and grammar check possible in text area of a web page. We have aspx pages which are used to construct letters. The browser based screens provide text area where the user can insert big chunks of text and submit it all to the server paragraph by paragraph. The requirement is to do a...
1
6943
by: AAA | last post by:
hi, I'll explain fastly the program that i'm doing.. the computer asks me to enter the cardinal of a set X ( called "dimX" type integer)where X is a table of one dimension and then to fill it with numbers X; then the computer asks me how many subsets i have (nb_subset type (integer)) then,i have to enter for every sebset the card, and then...
25
2518
by: Piotr Nowak | last post by:
Hi, Say i have a server process which listens for some changes in database. When a change occurs i want to refresh my page in browser by notyfinig it. I do not want to refresh my page i.e. every 5 seconds, i just want to refresh it ONLY on server change just like desktop applications do. The problem is that refreshing evry n seconds has...
4
7644
by: RSH | last post by:
Okay my math skills aren't waht they used to be... With that being said what Im trying to do is create a matrix that given x number of columns, and y number of possible values i want to generate a two dimensional array of all possible combinations of values. A simple example: 2 - columns and 2 possible values would generate: 0 0
7
3346
by: Robert S. | last post by:
Searching some time now for documents on this but still did not find anything about it: Is it possible to replace the entry screen of MS Office Access 2007 - that one presenting that default 'templates' (with that big graphic buttons) - with some sort of own HTML-Page? I could imagine, that somehow it is possible to change this construction...
14
1988
by: bjorklund.emil | last post by:
Hello pythonistas. I'm a newbie to pretty much both programming and Python. I have a task that involves writing a test script for every possible combination of preference settings for a software I'm testing. I figured that this was something that a script could probably do pretty easily, given all the various possibilites. I started...
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7563
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7125
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3252
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.