If I understand what you are trying to do correctly you could try the
getServletContext().getPath( your_URL )

or

getServletContext().getURL( your_path )

inside your servlet code to translate what you send from the applet.  (check
the servlet API for exact calls as I don't have it in front of me at the
moment).

  _____

Richard Gill
Director   3KB.COM LIMITED
Suite 2 Level 1, 10 Turner Street,
Po Box 74-307, Auckland, New Zealand
Tel: +64-9-379-7574    Fax: +64-9-379-7821
Mob: +64-21-709-071  Email:  [EMAIL PROTECTED]
Web: www.3kb.com


> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> Abhishek Vishwakarma
> Sent: Monday, 12 March 2001 3:23 p.m.
> To: [EMAIL PROTECTED]
> Subject: File Downloading !!!
>
>
> Hi All,
>
> I m trying for a http download from a server. For this at the
> client side i am
> having
> an applet which initiates the dowloading process. And at server
> side i have a
> servlet
> or a jsp that does some encoding and pushing process to the
> client for the files
> through a URL connection. But i want to skip the encoding process
> at the server
> side
> through the use of any stardard API.
>
> Like for example i can use Class.getResourceAsStream() in my
> applet class for
> getting a file stream of the file on the server.  But the problem
> here is that
> the particular
> file should be in the context i.e i can only give relative path.
> But what i want
> is that
> my path of the file should not be relative and but real path like ....
>
>      c:/abc.txt  ( on server )
>
> But as expected it does not work... as the Class Loader is does
> not able locate
> it.
> So here come the problem...
>
>  "Can I be able to use the real path to do the same job through the use
> getResourceAsStream()
>      or some other  API if i can modify the Class Loader. If then
> how can i
> achive this..??? "
>
> Please help me out in what i think or if there is any other
> better way of doing
> this then
> please me know...
>
> regards,
>
> Abhishek Vishwakarma
>
> __________________________________________________________________
> _________
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to