Hi all,
I am trying to make link to a dynamically generated
zip file which the user can download. It links to a
jsp page like so:
a href=audio_download.jspDownload Audio/a
In audio_download.jsp, I have the following code to
generate the zip:
jsp:useBean scope=session id=myLatestAudioFiles
Try this. I used it for JNLP, but it should work for zip. Just
replace .jnlp with .zip
String fileName = request.getServletPath();
fileName = fileName.substring(fileName.lastIndexOf(/) + 1);
fileName = fileName.substring(0, fileName.indexOf(.)) + .jnlp;
response.addHeader(Content-Disposition,
that works. thanks.
Eugene
--- Darren Govoni [EMAIL PROTECTED] wrote:
Try this. I used it for JNLP, but it should work for
zip. Just
replace .jnlp with .zip
String fileName = request.getServletPath();
fileName =
fileName.substring(fileName.lastIndexOf(/) + 1);
fileName =
: Ostad, James [EMAIL PROTECTED]
To: Tom (E-mail) [EMAIL PROTECTED]
Sent: Monday, November 24, 2003 4:24 PM
Subject: download file issue
I have created a web site that allows users to download files.
It is working at the server level, but not out site of the server, at
user level.
Server is win2k
Sorry, wasn't looking at list in date order!!
A.
- Original Message -
From: Andoni [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, November 25, 2003 10:33 AM
Subject: Re: download file issue
Please give a little more detail about what actually goes wrong
I appreciate your trying to help.
Thanks,
James
-Original Message-
From: Andoni [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 25, 2003 5:55 AM
To: Tomcat Users List
Subject: Re: download file issue
Sorry, wasn't looking at list in date order!!
A.
- Original Message
I have created a web site that allows users to download files.
It is working at the server level, but not out site of the server, at
user level.
Server is win2k adv. server.
Tomcat is 4.1.29
Any suggestion would appreciated.
James
Out--- (1)
James,
I have created a web site that allows users to download files.
It is working at the server level, but not out site of the server, at
user level.
Can you describe what you mean by doesn't work outside the server?
What happens when you try to download?
-chris
.
Thanks
James
-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 11:57 AM
To: Tomcat Users List
Subject: Re: download file issue
James,
I have created a web site that allows users to download files.
It is working at the server level
James,
I am not using IIS at this time.
So, this is standalone Tomcat. Okay.
I am able to login, pass the information, and even get the database file
information with an hyperlink to the file. But when I double click on it
gives me an error page, or if I right click on it to save the target as,
appreciate your help.
James
-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 12:09 PM
To: Tomcat Users List
Subject: Re: download file issue
James,
I am not using IIS at this time.
So, this is standalone Tomcat. Okay.
I am able to login
James,
Here is the error page:
The page cannot be displayed
The page you are looking for is currently unavailable. The Web site
might be experiencing technical difficulties, or you may need to adjust
your browser settings.
Sorry for the back-and-forth: is this a Tomcat error (light blue and
the hyperlink, at the bottom of the status
bar I see this address:
file://ipaddress/temp$/ceo/test/temp$/00064735.tif(local)
-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 12:30 PM
To: Tomcat Users List
Subject: Re: download file
James,
You have no idea what I have gone through to figure this out.
I will do this as long as you last.
That is not a tomcat error. It is an IE error.
\\ipaddress\temp$\ceo\test\temp$\00064735.tif
I have not activated the DNS yet, that is why the IP address is showing
up.
when I move the cursor
, at the browser level I see only the file name, before getting this
error.
James
-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 2:18 PM
To: Tomcat Users List
Subject: Re: download file issue
James,
You have no idea what I have gone through
the file from source to target
- then create this path format for url download, as you directed me
Thank you so much,
James
-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 2:18 PM
To: Tomcat Users List
Subject: Re: download file
James,
With your help, I got it to work.
Thank you so much,
Glad you got it working.
-chris
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
);
return;
}
chain.doFilter(req,resp);
}
-Original Message-
From: Lars Nielsen Lind [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 17, 2002 5:34 PM
To: Tomcat Users List
Subject: Re: Hide download file
Cox, Charlie wrote
Hi.
We are using an Upload component to upload files to the server. The
files are placed in /fileserver/files - a directory outside of webapps.
Anyone that have example files on how to retrive the files (download)
via JavaBean/JSP from a directory outside of webapps?
Best regards,
Lars
On Wednesday 17 July 2002 16:48, you wrote:
Hi.
We are using an Upload component to upload files to the server. The
files are placed in /fileserver/files - a directory outside of webapps.
Anyone that have example files on how to retrive the files (download)
via JavaBean/JSP from a
: Hide download file
On Wednesday 17 July 2002 16:48, you wrote:
Hi.
We are using an Upload component to upload files to the server. The
files are placed in /fileserver/files - a directory outside
of webapps.
Anyone that have example files on how to retrive the files
(download
List
Subject: Re: Hide download file
On Wednesday 17 July 2002 16:48, you wrote:
Hi.
We are using an Upload component to upload files to the server. The
files are placed in /fileserver/files - a directory outside
of webapps.
Anyone that have example files on how to retrive the files
I just answered this last week. Use a filter that checks the session and
leave your download files in a directory under webapps. Filters make this
simple. Don't do any more work than you need to :)
Charlie
I have found an article at www.javaworld.com about witing
servlets for
session
variable defined access to download file(s)?
Best regards,
Lars Nielsen Lind
--
To unsubscribe, e-mail: mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Subject: download file
From: J. Jason Zhou [EMAIL PROTECTED]
===
I have both Tomcat and IIS running on two machines. But when I download a
file (abc.xls) from Tomcat, the browser loads the binary content without
prompting uisng the save/open dialog while IIS did prompt before the
download.
http
:download file
Subject: download file
From: J. Jason Zhou [EMAIL PROTECTED]
===
I have both Tomcat and IIS running on two machines. But when I download a
file (abc.xls) from Tomcat, the browser loads the binary content without
prompting uisng the save/open dialog while IIS did prompt before
:[EMAIL PROTECTED]]
Sent: Tuesday, July 16, 2002 10:10 AM
To: [EMAIL PROTECTED]
Subject: download file
Subject: download file
From: J. Jason Zhou [EMAIL PROTECTED]
===
I have both Tomcat and IIS running on two machines. But when I download a
file (abc.xls) from Tomcat, the browser loads the binary
At 11:43 AM 7/11/2002 -0500, you wrote:
I'm going to have to inevitably add it to my site soon, I was going to
approach it the same way, but with a servlet isn't it possible to pipe a
file by setting the response mime type and streaming it out as a PDF or
EXE. Of course IE does it's own thing no
Hi all,
I need to pick your brains again.
I need to publish a site that requires a user to fill in a form before
displaying a download link.
What I need to do is to hide the file to be downloaded so that it cannot be
downloaded without the form being filled in - i.e it can only be downloaded
Certainly not the most elegant solution but you could keep the real file
in a unreachable location, and upon submitting it copy's the file to a
cookie_date_time_filename.ext and has them download that. Then you run a
cleaner script to erase these temp files after 24 hours.
Alex
Hi all,
Message-
From: Alex Short [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 11, 2002 11:36 AM
To: Tomcat Users List
Subject: Re: How to hide a download file
Certainly not the most elegant solution but you could keep the real file
in a unreachable location, and upon submitting it copy's the file
Passey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 11, 2002 12:24 PM
To: Tomcat Users List (E-mail)
Subject: How to hide a download file
Hi all,
I need to pick your brains again.
I need to publish a site that requires a user to fill in a form before
displaying a download link.
What I need
To: Tomcat Users List
Subject: Re: How to hide a download file
Certainly not the most elegant solution but you could keep
the real file
in a unreachable location, and upon submitting it copy's the
file to a
cookie_date_time_filename.ext and has them download that.
Then you run
to and it gets redirected when you want it to.
Charlie
-Original Message-
From: Turner, John [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 11, 2002 12:46 PM
To: 'Tomcat Users List'
Subject: RE: How to hide a download file
Off the top of my head, couldn't you pipe together
input.
Kevin
-Original Message-
From: Cox, Charlie [mailto:[EMAIL PROTECTED]]
Sent: 11 July 2002 17:46
To: 'Tomcat Users List'
Subject: RE: How to hide a download file
you can use a filter to see if the referring page is your form and then
allow the download or redirect to your form
PM
To: 'Tomcat Users List'
Subject: RE: How to hide a download file
I was thinking of setting something in the session for the
download page
anyway which would direct a user back to the form.
But if I create a directory called downloads and put the
file in there -
what's to stop
If you make them login, you could put a security constraint on your
downloads directory. That would pretty well seal it up, I believe =)
HTH,
Eddie
Kevin Passey wrote:
snip
But if I create a directory called downloads and put the file in there -
what's to stop someone just typing the
Why don't you just handle it by putting something in their session
saying that they filled out the form correctly, and write a downloader
servlet that looks for that something, and will only send them the bits
if they've filed out the form? Writing a servlet to send a file is
pretty darned
are not present)
-Ursprüngliche Nachricht-
Von: Ian McFarland [mailto:[EMAIL PROTECTED]]
Gesendet: Freitag, 12. Juli 2002 00:59
An: Tomcat Users List
Betreff: Re: How to hide a download file
Writing a servlet to send a file is pretty darned trivial.
Writing one that knows something about
HI
I trying make servlet for downloading of files.
When I use:
FileInputStream fl=new FileInputStream(dir);
byte b[]=new byte[4096];
int len=0;
ServletOutputStream souts=_response.getOutputStream();
while(len!=-1){
len=fl.read(b);
On Thu, 6 Sep 2001, Evgeniy Strokin wrote:
Date: Thu, 6 Sep 2001 11:43:56 -0400
From: Evgeniy Strokin [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: Tomcat-User@Jakarta. Apache. Org [EMAIL PROTECTED]
Subject: How download file from servlet?
HI
I trying make servlet for downloading
There is already a _response.getWriter() or getOutputStream() before your
code snippet
Mvgr,
Martin
-Original Message-
From: Evgeniy Strokin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 06, 2001 5:44 PM
To: Tomcat-User@Jakarta. Apache. Org
Subject: How download file
I have a file stored in the backend Oracle database
and has JSP communicating with the database in JDBC.
I would like to allow user to click on a hyperlink and
then download the file which is stored in the
database.
Is this possible? If so, what are the steps to
implement it?
Thanks,
MH
Mon-Quen Huang wrote:
I have a file stored in the backend Oracle database
and has JSP communicating with the database in JDBC.
I would like to allow user to click on a hyperlink and
then download the file which is stored in the
database.
Is this possible? If so, what are the steps to
SUB:TOMACT DOWNLOAD FILE(WHERE??) AT JAKARTA FOR WIN98/NT
Dear all,
can anyone of you please tell which file to download for tomcat3.2.1 for
WIN98/NT OS.:
(http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.1/bin)
Index of /builds/jakarta-tomcat/release/v3.2.1/bin
[DIR
The right file is
jakarta-tomcat-3.2.1.zip
Bye!!!
Roberto Robuschi
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
. Then very
carefully follow the install instructions.
Rick
R N Mukherjee wrote:
SUB:TOMACT DOWNLOAD FILE(WHERE??) AT JAKARTA FOR WIN98/NT
Dear all,
can anyone of you please tell which file to download for tomcat3.2.1 for
WIN98/NT OS.:
(http://jakarta.apache.org/builds/jakarta-tomcat
47 matches
Mail list logo