Uploading a file from jsp page on weblogic portal 9.2 into VCR content node

I am working on Content Management in Weblogic Portal 9.2 using the com.bea.content API. I have succedded to the extent that I have created "Node" both Hierarchy and Content Node in the Virtual Content Repository using the CM API from a JSP.
Now I have to upload a file from this JSP into VCR Content Node. I am facing some problems. I am not able to figure out which class to use for this purpose from CM API. Please help in this regard.

Hi,
You need to ensure you're using an ObjectClass with a PropertyDefiition of type Property.BINARY. Then, construct a BinaryValue with your InputStream. Use that to construct the Value and Property for the Node you're creating or updating.
-Ryan

Similar Messages

  • Forwarding to an xml file from jsp page

    hi
    i am subhash. i have problem in forwarding an xml file from jsp page.
    i have a jsp page in which i have a button. upon click, its form method is triggered and the action is set to "serverpage.jsp". In that jsp page i have to move to an xml file. I would like u to send a sample code also for the same.
    Thank You,
    Subhash..

    Refer to the Generating XML from JSP section.
    http://java.sun.com/developer/technicalArticles/xml/WebAppDev2/

  • How to call cystal report8 report file from jsp page

    hi guys
    present i am using cystal report8 already i am having ReportViewer.jar and ReportviewerBean.jar files
    using that please send me sample code how to call that report from jsp page..
    and how to pass the parameters from jsp page to crystalreport8 report file.
    it was very urgent task to me..so please send sample code on above topic..
    or send me crystalreport8 API
    thanks
    regards

    Hi,
    I also want to work on crystal report but i dont have the ReportViewerBean.jar and ReportViewer.jar. So, please tell from where will i get those jar files.
    Thanks in advanced.

  • Problem in uploading a file from JSP to SQL server

    Hi,
    I am using jspsmart ( www.jspsmart.com)to upload a file in a database.
    The problem is that when I am going to download the file and display in the browser, I got the file spoiled by other text on it, in a case of word file I get at the beginning the 'Content-Disposition' and some other strange txt staff, plus my document.
    I don't know in what direction investigate.
    Thanks in advance
    Leonardo

    Perhaps you could try anothers components :
    UploadBean + Download4J :
    http://www.javazoom.net/jzservlets/uploadbean/uploadbean.html
    http://www.javazoom.net/jzservlets/download4j/download4j.html

  • How to get the complete path name when uploading a file from servlet

    Hi,
    I write a servlet to upload a file from html page
    <intput type=file name=fileupload>I am using
    import org.apache.commons.fileupload.to upload file. i want to get the all fields in the form and file name and content of the file also.
    It give the file name only
    String filename= fileItem.getName();
    o/p krish.jpgBut i want complete path naem like
    d:/krishna/images/funny/krish.jpgI serach the API org.apache.commons.fileupload.*
    But i did nt find the method to get it.
    plz help me , which api or method to use here..

    Krishna_Rao_chintu wrote:
    But i need path and have to do some calculations on it.No, you don't. If you have requirements which say you do then the requirements are wrong. You couldn't do anything useful with the path on the client system even if you could get it.
    is there any alternatives in java
    I need path and have to calculate MD5, Presumably you need to calculate MD5 on the contents of the file and not on the name of the file.
    and convert the file to binary format.... etc oprations on itSorry, "convert a file to binary format" is basically meaningless.
    but we can get the content of the file using
    byte [] get()/ getString() methods
    If i get content is there any performance degrades?
    ie if the content is lengthy is it take more time?Take more time than what? Degrading performance from what? It's certainly true that it would be quicker to not upload the file, but that's a pointless comparison. If you have some other process to compare with, let us know what it would be.

  • How to load java class from jsp page?

    hi all!
    Does anyone know how to load java class from jsp page?
    I try to load java class from jsp page.
    Is it possible to load java class fom jsp page?
    thanks and have a good day!

    What I mean is How to load/open java class file from jsp page?
    I think we can open Applet from jsp page by using
    <applet code=helloApplet.class width=100 height=100>
    </applet>
    but, how to open java class which is an application made by Frame?
    thanks and have a good day

  • To upload a file from client machine to server machine

    Hi everybody!
    Could anyone plz help me. I am struck in a problem
    I want to transfer a file from client's machine to server but I am not able to upload
    It is tranferring the file only to the local machine
    I am using orielley package It is transferring files only to my local machine but not to the server .Can anyone correct it. It's very urgent
    how to write the relative path for server
    I am using this path and it is not uploading
    MultipartRequest multi = new MultipartRequest(request, "../<administrator>:<dev2daask>@dev2:C:/123data/", 5 * 1024 * 1024);
    Here is my code:
    <%@ page import="java.util.*" %>
    <%@ page import="javax.servlet.*" %>
    <%@ page import="javax.servlet.http.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="com.oreilly.servlet.MultipartRequest"%>
    <%
    try {
    // Blindly take it on faith this is a multipart/form-data request
    // Construct a MultipartRequest to help read the information.
    // Pass in the request, a directory to saves files to, and the
    // maximum POST size we should attempt to handle.
    // Here we (rudely) write to the server root and impose 5 Meg limit.
    MultipartRequest multi = new MultipartRequest(request, "../<administrator>:<dev2daask>@dev2:C:/123data/", 5 * 1024 * 1024);
    out.println("<HTML>");
    out.println("<HEAD><TITLE>UploadTest</TITLE></HEAD>");
    out.println("<BODY>");
    out.println("<H1>UploadTest</H1>");
    // Print the parameters we received
    out.println("<H3>Params:</H3>");
    out.println("<PRE>");
    Enumeration params = multi.getParameterNames();
    while (params.hasMoreElements()) {
    String name = (String)params.nextElement();
    String value = multi.getParameter(name);
    out.println(name + " = " + value);
    out.println("</PRE>");
    // Show which files we received
    out.println("<H3>Files:</H3>");
    out.println("<PRE>");
    Enumeration files = multi.getFileNames();
    while (files.hasMoreElements()) {
    String name = (String)files.nextElement();
    String filename = multi.getFilesystemName(name);
    String type = multi.getContentType(name);
    File f = multi.getFile(name);
    out.println("name: " + name);
    out.println("filename: " + filename);
    out.println("type: " + type);
    if (f != null) {
    out.println("length: " + f.length());
    out.println();
    out.println("</PRE>");
    catch (Exception e) {
    out.println("<PRE>");
    out.println("</PRE>");
    out.println("</BODY></HTML>");
    %>

    you have not understood my point
    how does this code will run on servlet when I want to upload a file from client's
    machine to server machine
    what I am doing is I am giving an option to the user that he/she can browse the file and then select any file and finally it's action is post in the jsp form for which I have sent the code
    All the computers are connected in LAN
    So how to upload a file from client's machine to server's machine
    Plz give me a solution

  • Error while uploading the file from Allpcation server in LSMW-7th step

    Hi Experts,
    what should be the specific CODE PAGE should be maintained while uploading the file from application server in LSMW-7th Step
    Thanks in advance,
    KSR

    Hi
    I mean that there is any seperate CODE PAGE which comes at the bottom of screen while uploading the file from the application server in 7th step.
    Is there any specific CODE PAGE to be maintained...
    Thanks in advance
    Oarsk

  • Unable to open .chm file from a link in Weblogic 7.0

    Unable to open .chm file from a link in weblogic server. But the same
    jsp code works in Websphere
    Sample Code :
    <!-- < a href="JavaScript:window.navigate('help/manual.CHM')">
    Linked Text</a> -->
    The above link, works well in websphere. help is a folder that
    resides in the server. But when i tried to execute the same in
    Weblogic, some junk characters appeared . so i tried to direct the
    link to Display.jsp and passed the path of the chm file as the
    parameter. I cleared teh out buffer using out.clearBuffer() . i set
    the content type to application/x-msdownload and also set the header
    to content disposition.
    Nothing worked .
    I also tried another way.. That is the following
    I even tried including the mime type
    <mime-mapping>
    <extension>chm</extension>
    <mime-type>application/x-msdownload</mime-type>
    </mime-mapping>
    in the web.xml file. and still it doesnt work
    Nothing Worked . What should i do ? I need immediate help to sort out
    this issue. Can anybody help me
    - Angel

    This could be a Launch Services issue. The following article describes how to manually reset Launch Services — the notes at the bottom of the article also provide information about the side effects of deleting each of the files involved:
    Resetting Launch Services
    If you prefer using a cache cleaning utility instead of following the manual procedure described in the previous article, take a look at this other article for general troubleshooting and cache-cleaning procedures. Actually, you should also verify/repair the startup disk (not just permissions), as described there:
    Resolving Disk, Permission, and Cache Corruption
    The most appropriate utility for this particular problem probably is Tiger Cache Cleaner, but you may also want to consider other utilities, such as OnyX, or Cache Out X, which are free. Whatever utility you choose, be sure to read this first:
    Side effects of System cache cleaning
    As an example, this is how you should proceed with OnyX:
    1. Quit all applications.
    2. Launch OnyX and enter your administrator password.
    3. Go to Maintenance > Reset and check LaunchServices database.
    4. Un-check any other pre-checked options.
    5. Click the Execute button.
    6. Restart the computer.
    BTW, if you’re running Mac OS X 10.4 (Tiger), as your profile indicates, it would have been more appropriate to discuss this in the Mail & Address Book - Tiger forum. If the discussion applies to both Mail 1.x and Mail 2.x, it doesn’t really matter, but it’s difficult to know that in advance.

  • Help please to Upload a file from my PC to server's KM

    Hello:
    I can't Upload correctly a file from my local PC to a KM of the server.
    My problem is after that I've uploaded any file from my PC to KM, sometimes when I open or download it from the KM appears blank, and when I try another way to write the file (out.write()) I've uploaded a bad file that can't be downloaded or opened it. I can't get the file Data of the file for uploading, I need to set it with the fileResource (I tried with fileResource.read(false))
    I use a FileUpload in my view.
    <b>My Context:</b>
    File (node)
         |----fileResource  (com.sap.ide.webdynpro.uielementdefinitions.Resource)
         |----fileData  (binary)   
         |----fileName  (String)
    wdDoInit(){
         IPrivateUploadDownloadKMView.IFileElement fileBind = wdContext.createFileElement();
         wdContext.nodeFile().bind(fileBind);
         IWDAttributeInfo attInfo = wdContext.nodeFile().getNodeInfo().getAttribute("fileData");
         ISimpleTypeModifiable type = attInfo.getModifiableSimpleType();
    onActionSubir(){
          IPrivateUploadDownloadKMView.IFileElement fileElement = wdContext.currentFileElement();
          IWDResource resource = fileElement.getFileResource();
          fileElement.setFileName(resource.getResourceName());
          fileElement.setFileData(fileData);
          byte[] fileData=new byte[resource.read(false).available()];
          fileElement.setFileData(fileData);
          fileName = fileElement.getFileName();
         try{               
               File file = new File(fileName);
               FileOutputStream out = new FileOutputStream(file);
               out.write(fileElement.getFileData());
               out.close();
               fin = new FileInputStream(fileName);
               fin.read();
               Content content = new Content(fin,null, -1);
                IResource newResource = folder.createResource(fileElement.getFileName(),null, content);
          catch(Exception e){
                 IWDMessageManager mm = wdControllerAPI.getComponent().getMessageManager();
                 mm.reportWarning("error: "+e.getMessage());
    Can you help me?, any sugestions to solve my problem or improve my code?
    Regards
    Jonatan.

    If you have got the permission to access <b>content management</b> in portal appliction server consle,then click on content management >select the KM Repository and clik on it.Then right click on <b>folder</b>>new-->upload.After clicking the upload option one page will be open and then you can browse your local file and upload to the KM Repository.

  • How to Upload a file in JSP ( doc,  txt ) as an attachment

    I want to upload a file using JSP. I tried Jason's Multipart program, but it is creating some problem. Pls suggest me the alternate. How to write a code. Is there any bean available for free download. Pls. help me.
    - Ashok Mudalagi
    [email protected]

    I have successfully used Multipart classes from Oreilly. I believe that's the same one you are referring to. I have implemented my Upload using a servlet though. If you can post what exactly is your trouble using that code, I will be glad to help you with it.

  • How to move a file from a page to another one in a wiki?

    Is it possible to move a file from a page to another one in a wiki (wiki server 4)?

    Files uploaded via "+" button and "Upload File to "My wiki name"" can be moved just like normal wiki pages by clicking the "sprocket" button and selecting "Move to Wiki"
    Fils attached via the "paperclip" button when editing a page, must be downloaded first, deleted from the initial page and reattached to the new page.

  • How to call java class file from jsp

    hi
    we need to call java classes (which are written separately in .java file )from jsp file. we need it for our project if anyone knows about please reply us.
    bye
    siva sankari

    you can call the methods in a lot of ways. you could use scriptlets with the
    <%@ page import="package.class"%> and then inside instantiate an object
    <%
         MyClass mc = new MyClass(parameters if any);
         mc.theMethodYouWantToCall();
    %>or as Madathil has stated,
    or use the JSP tags
    <jsp:useBean id="anyname" class="classname"/>and then use the getProperty tag
    or even Custom Tags

  • Calling java class from jsp page

    Dear Friends.
    I wrote jsp page and java class.
    Am calling java class from jsp page. after processing result,
    I have to refresh jsp page from java class.
    processing time may take 5 minutes or 1 minute etc. that depends on user.
    Can It be possible ? if possible , How ?

    Ok, I get a very strange error now:
    org.apache.jasper.JasperException: Unable to compile class for JSPerror: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
    What is this??? Anyone?

  • Calling Beans from JSP page

    hi,
    I tried to my best to call java beans from JSP page but it generate error that "unable to load class....", please help me that in which directory jsp file and bean *.class file reside, currently my setting are as follows.
    Note: I am using tomcat server and my jsp and servlet files are running seccessfuly, there is any special change in classpath for java beans? if any please tell
    My jsp file is in tomcat-->webapps-->jsp--><my file>
    My bean (*.class) file-->webapps-->Root-->web-inf-->classes--><my file>
    Pleae help me for the above problem.
    Mubashar ([email protected])

    According to J2EE standards:
    The web appl directory structure should be:
    WebAppRootDirectory
    |
    |---html, jsp, images etc
    |
    |---WEB-INF---
    |---classes--
    |---lib
    |
    |
    1) Make sure WEB-INF is in capital letters
    2) Place all ur beans in classes dir or sub-directory in
    classes
    3) In Tomcat place WebAppRootDirectory in webapps
    directory
    [email protected]

Maybe you are looking for