[opencms-dev] File path in opencms

Qi Zhang kksjtu at gmail.com
Tue Jul 19 00:42:30 CEST 2016


Hi Kiran,

thank you so much! You've done me a great favor! ;)

Cheers,
Qi

2016-07-18 11:33 GMT+02:00 kiran g <kiran.blgt at gmail.com>:

> Hi,
>
> If you need the contents of the file, you can get it in a byte array using
> something like the following:
>
> CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,
> response);
> CmsObject cmso = cms.getCmsObject();
> CmsFile cmsFile= cmso.readFile("/login/download.jpg");
> byte[] contents=cmsFile.getContents();
>
> You can then write the byte array to FileOutputStream.
>
>
>
> -----
> Cheers,
> Kiran
> --
> View this message in context:
> http://opencms.996256.n3.nabble.com/File-path-in-opencms-tp26357p26358.html
> Sent from the OpenCMS mailing list archive at Nabble.com.
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20160719/edd78052/attachment.htm>


More information about the opencms-dev mailing list