[opencms-dev] Uploading a file in OpenCms

srinivas voleti srini_2105 at hotmail.com
Wed Oct 29 17:11:00 CET 2003


Hi,

Iam also using 5.0 only and I have seen this method in OpenCms Source - 
CmsShellCommands.java

    /**
     * Loads a File up to the cms from the lokal disc.
     *
     * @param lokalfile The lokal file to load up.
     * @param folder The folder in the cms to put the new file
     * @param filename The name of the new file.
     * @param type the filetype of the new file in the cms.
     */
    public void uploadFile(String lokalfile, String folder, String filename, 
String type) {
        try {
            System.out.println((CmsFile)m_cms.createResource(folder, 
filename, type, null, importFile(lokalfile)));
        }
        catch(Exception exc) {
            CmsShell.printException(exc);
        }
    }

Srini.

>From: "Hartmann, Waehrisch & Feykes GmbH" <hartmann at waehrisch-feykes.de>
>Reply-To: opencms-dev at opencms.org
>To: <opencms-dev at opencms.org>
>Subject: Re: [opencms-dev] Uploading a file in OpenCms
>Date: Tue, 28 Oct 2003 16:06:54 +0100
>
>Wich version are you using ? Mine (5.0) does not have this method.
>
>----- Original Message -----
>From: "srinivas voleti" <srini_2105 at hotmail.com>
>To: <opencms-dev at opencms.org>
>Sent: Tuesday, October 28, 2003 3:34 PM
>Subject: [opencms-dev] Uploading a file in OpenCms
>
>
> > Hi All,
> >
> > Iam trying to upload a file programatically using the cmsObject method
> >     uploadFile(String lokalfile, String folder, String filename, String
> > type)
> >
> > but I'm getting the following error
> >
> > An error occurred at line: -1 in the jsp file: null
> >
> > Generated servlet error:
> >     [javac] Since fork is true, ignoring compiler setting.
> >     [javac] Compiling 1 source file
> >     [javac] Since fork is true, ignoring compiler setting.
> >     [javac]
> >
>C:\tomcat\jakarta-tomcat-4.1.24\work\Standalone\196.12.47.57\opencms\WEB-INF
>\jsp\offline\UploadFile_jsp_jsp.java:98:
> > cannot resolve symbol
> >     [javac] symbol  : method uploadFile
> > (java.lang.String,java.lang.String,java.lang.String,java.lang.String)
> >     [javac] location: class com.opencms.file.CmsObject
> >     [javac] cmsObject.uploadFile("c:/Samp.html",
> > "/TRXDOCS/SriniTestHierarchy/", "uploadf", ".html");
> >     [javac]          ^
> >     [javac] 1 error
> >
> > Any parameter is missing.
> >
> > Thanks,
> > Srini.
> >
> > _________________________________________________________________
> > Are you a Citibank RCA member? Want to fly free to India?
> > http://server1.msn.co.in/sp03/diwali/rca/memberrca.asp Here is how you
>can!
> >
> > _______________________________________________
> > This mail is send to you from the opencms-dev mailing list
> > To change your list options, or to unsubscribe from the list, please 
>visit
> > http://mail.opencms.org/mailman/listinfo/opencms-dev
> >
>
>_______________________________________________
>This mail is send to you from the opencms-dev mailing list
>To change your list options, or to unsubscribe from the list, please visit
>http://mail.opencms.org/mailman/listinfo/opencms-dev

_________________________________________________________________
Tired of emails bouncing back? Need more space? 
http://server1.msn.co.in/features/general/extrastorage/index.asp Get extra 
storage on Hotmail




More information about the opencms-dev mailing list