realtive path
I created another direcory in this directory and sotred a file there to which i want to link from a note
The link to the file is:
"C:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\\application context\downloadables\\my file.msi
Instead of giving full path i want to give relative path..
Would there be a way to do this via a 'relative path' .
like:
..\my application\downloadables\my file.msi
Thanks alot
[479 byte] By [
akaura] at [2007-11-27 11:04:45]

> Would there be a way to do this via a 'relative path'
> .
> like:
> ..\my application\downloadables\my file.msi
Did you try it?
> I created another direcory in this directory and
> sotred a file there to which i want to link from a
> note
>
> The link to the file is:
> "C:\\Program Files\\Apache Software
> Foundation\\Tomcat 5.5\\webapps\\application
> context\downloadables\\my file.msi
> Instead of giving full path i want to give relative
> path..
>
>
> Would there be a way to do this via a 'relative path'
> .
> like:
> ..\my application\downloadables\my file.msi
Yes. That
what is syntax for that
akaura at 2007-7-29 13:03:36 >

i tried this... its not working
akaura at 2007-7-29 13:03:36 >

kya baqwaaz, <<it is not working>>? kee horha hai, kuddi?
> i tried this... its not working
We need more details. Is this a webapp? What did the link end up being when you tried to use it?
here is the full code how i did:
<%@ page import="java.io.*" %>
<%
//this is to download Excel Client
FileInputStream fis = new FileInputStream("C:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\\ptoject name\\download folder\\file.msi");
BufferedInputStream bis = new BufferedInputStream(fis);
response.setContentLength(fis.available());
response.setContentType("application/octet-stream");
response.setHeader("Content-disposition","attachment; filename=XTM_Study_v1-0-7-beta.msi" );
BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream());
byte[] buff = new byte[1024];
int bytesRead;
// Simple read/write loop.
while(-1 != (bytesRead = bis.read(buff, 0, buff.length)))
{
bos.write(buff, 0, bytesRead);
}
bos.flush();
bos.close();
bis.close();
response.flushBuffer();
fis.close();
%>
Instead of giving full path "C:\\program files\\apache......"
i need to give relative path.. I need to know how can i give relative path?
akaura at 2007-7-29 13:03:36 >

Why can't you simply use HTTP?
<a href="\xxx\yyy.msi">Download<a>
is there anyone who can help me...
akaura at 2007-7-29 13:03:36 >

wow, ਪੰਜਾਬੀ (ਭਾਰਤ) is broken if I try to use either a single or double quotation mark as in an href attribute.
> Why can't you simply use HTTP?
> > <a href="\xxx\yyy.msi">Download<a>
You mean HTML.
> > Why can't you simply use HTTP?
> > > > <a href="\xxx\yyy.msi">Download<a>
>
> You mean HTML.
I think he meant let the user download the program over http by giving them a link, instead of writing the contents of the file into the response, which is completely stupid. Even redirecting them to the url of the file would be better.
OP, I'll try one last time. When you open the FileInputStream with the relative url, what's the actual url that it tries to open?
i tried that way but when i left cliick then its not giving me anything and when i right click and tried "save target as" that way i can only save that file but i need a dialogue box that asks users whether to save run or cancel file download.
akaura at 2007-7-29 13:03:37 >

when i tried to give realtive path... its giving the error "file not found"
akaura at 2007-7-29 13:03:37 >

FileInputStream fis = new FileInputStream("C:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\\ptoject name\\download folder\\file.msi");
ptoject name ?
And for God's sake, use STANDARD directory notation, not Windows ****:
/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/"ptoject name"/download folder/file.msi
anybody there to help me..?
akaura at 2007-7-29 13:03:45 >

> anybody there to help me..?
lol. I'm done here.
sorry Mr. Gardener.. I just started working in java... i ll keep that in mind
akaura at 2007-7-29 13:03:45 >

sorry Mr. Gardner..
akaura at 2007-7-29 13:03:45 >

> sorry Mr. Gardner..
Are you sure the directory is named "ptoject name" ?
maybe it is named "project name" and you misspelled it?
director name actual is "XTM" and the i have created folder named "downloadables" in that where my file is saved..
akaura at 2007-7-29 13:03:45 >

directory name actual is "XTM" and the i have created folder named "downloadables" in that where my file is saved..
i typed it fast so it was misspelled
akaura at 2007-7-29 13:03:45 >

no solution
akaura at 2007-7-29 13:03:45 >

maharaaj daso na pher solution..
i have one more issue.. how can i configure my filename.jsp as the default page in spring MVC
akaura at 2007-7-29 13:03:45 >

> maharaaj daso na pher solution..
mai tera sahib hai, kuddi?
didnt get u
akaura at 2007-7-29 13:03:45 >
