[opencms-dev] How to provide the upload and download

Nico Krause Nico.Krause at nsc.eu.com
Wed Jan 22 09:37:08 CET 2003


Hi Deepak,

I used something like this in a JSP for Uploading...

com.opencms.file.CmsObject cms =
((com.opencms.flex.cache.CmsFlexRequest)request).getCmsObject();

 Enumeration files = cms.getRequestContext().getRequest().getFileNames();
//do something with the files by
while(e.hasMoreElements(){
	String this_filename = (String) e.nextElement();
	byte[] filecontent = req.getFile(this_filename);
	....
}

Save the filecontents somewhere in the file system - or I think in the VFS
it's also possible, if needed.

Downloading a file with OpenCMS maybe JSP or with standard OpenCMS template/
java object techniques,  I did not until now! 

But it would be interesting how would work with template.setData(..,..) If
it is possible to put some binary content into template.setData or not.
I think so.  I would try it in that way first. I would be careful within the
template which brings the data to top.  So there should be no new lines or
spaces in it which could destroy the data standard of maybe a JSP or PDF or
what ever else... 

Hope it helps...

Nico



-----Original Message-----
From: deepaksawdekar [mailto:deepaksawdekar at infosys.com] 
Sent: Mittwoch, 22. Januar 2003 08:02
To: opencms-dev at www.opencms.org
Subject: [opencms-dev] How to provide the upload and download 

Hi,
	Please provide me some pointer regarding How to provide a upload and
dowload various docs ( like MS word, pdf etc)using  opencms.


thanks and Regards
Deepak 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20030122/1937aa6a/attachment.htm>


More information about the opencms-dev mailing list