Jahia Dev Forum > How to get the fullpath...

0 (0 Good)
0 (0 Bad)

How to get the fullpath of a file?

by  giantjack »  2011/06/07 20:34

Hi,

I'm currently working on a function which can force the download of a file after a click on a link.
The code is ready but I encounter a last problem :
[color=#BF0000:2x91zvjx]to force the download I need the fullpath of the file, but all I get for the moment with Jahia API/JSTL is just a path like quot;/file/shared...

  (giantjack)

Number of messages  8
Registration date
0 (0 Good)
0 (0 Bad)

Re: How to get the fullpath of a file?

by  shuber »  2011/06/07 20:34

If you need to reconstruct the absolute path, you can simply use the information in the request object that is the default JSP object. You can get getServerHost(), getServerPort(), etc...

Regards,
Serge Huber.

Serge Huber (shuber)

Number of messages  271
Registration date
Contact
Share
Feedback

Get in touch

Whether you are a current user or if you are just evaluating Jahia, we are here to help.

Contact us

Share this page