Problem in FileUpload -part2

Hi,
Hav been discussing with Rajas in myRe: Problem in FileUpload and im able to upload my File(Excel).
I hav a Ztable with a keyfield userid and other field called file_content of type <b>XSTRING</b>.I hav succed in uploading and there is some xstring in Ztable too.
Created another BSP Program for Downloadng the File .Here i pass the keyfield param, and tried to retrieve the Xstring as suggested by Raja.When Clicking the download button im able to open an XL file contains only  Xstring...The problem is my Xstring is not converted back to the original file.
Hav one more query.While downloading will the Excel file resides in the same format?
Rgds,
Jothi.P

HI Raja,
Foll is the code in<b> OnInputProcessing</b> to Download Xstring into Excel file...
* event handler for checking and processing user input and
* for defining navigation
data: event type ref to cl_htmlb_event .
event = cl_htmlb_manager=>get_event( runtime->server->request ).
if event->event_type = 'click' .
  case event->id .
** DOWNLOAD TO EXCEL.
    when 'download'.
      data:v_string  type string,
      v_xstring type xstring,
      v_appl type string,
      v_len type i.
      select * from zess_upld into table itab.
      data : wa type zess_upld.
      loop at itab into wa.
        v_string = wa-file_content.
      endloop.
call function 'SCMS_STRING_TO_XSTRING'
  exporting
    text           = v_string
   mimetype       = 'APPLICATION/MSEXCEL; charset=utf-16le'
*   ENCODING       =
importing
   buffer         = v_xstring
* EXCEPTIONS
*   FAILED         = 1
*   OTHERS         = 2
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
concatenate cl_abap_char_utilities=>byte_order_mark_little v_xstring
into v_xstring in byte mode.
v_appl = 'APPLICATION/MSEXCEL; charset=utf-16le'.
runtime->server->response->set_header_field( name = 'content-type' value
= v_appl ).
* Eliminating the cache problems when loading Excel Format
runtime->server->response->delete_header_field( name =
if_http_header_fields=>cache_control ).
runtime->server->response->delete_header_field( name =
if_http_header_fields=>expires ).
runtime->server->response->delete_header_field( name =
if_http_header_fields=>pragma ).
* Start excel in a separate window
runtime->server->response->set_header_field(
                 name = 'content-disposition'
                 value = 'attachment; filename=Order_list.xls' ).
* Displaying the data in excel.
v_len = xstrlen( v_xstring ).
runtime->server->response->set_data( data = v_xstring length = v_len ).
navigation->response_complete( ).
  endcase.
endif.
Rgds,
Jothi.P
How to create a table with File_content type Xstring.
    I can't able to create FIle_content of type Xstring as the ttable can't take more than 255 chars.
Hope this is my problem.How to resolve ?
Message was edited by:
        Jothi Periyasamy

Similar Messages

  • Problem in FIleUpload using myfaces-Tomhawk

    Hi,
    I am facing problem in implementing FileUpload.I am using Tomhawk and did everything as mentioned in the docs.I am getting the following error:
    java.lang.NoClassDefFoundError: javax/servlet/jsp/el/ELException
         at org.apache.myfaces.shared_tomahawk.config.MyfacesConfig.(MyfacesConfig.java:94)
         at org.apache.myfaces.renderkit.html.util.AddResourceFactory.getInstance(AddResourceFactory.java:282)
         at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:126)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    Any Help is appreciated

    For JSF 1.2 based frameworks you need el-api.jar and el-ri.jar.

  • Problem in FileUpload

    Hi,
    I want to know File Upload and Download in BSP.
    I hav run the BSP Appln <b>SBSPEXT_HTMLB / fileupload.htm</b>.It's seems to be working ok But ended up with foll queries.
    1.I don't know how to download the file from the server and where the uploaded files being stored ?
    2.Can i display the image of Excel in my BSP and if i click the image,want to download the File and after edting,it shd be upload again.
    3.I want to display a template file by default.
    4.The file upload and download should be user specific.
    5.Each year a new file to be created for user.
    6.If want to see Previous yr file by passing params,he shd retieve prv year uploaded file.
    Rgds,
    Jothi.
    Pts assured for helpful answers.

    <i>U mean the Ztable stores only the path of the upload file....</i>
    --> I mean Ztable stores the File contect..
    <i>I have thousand of employees and each user may have 4/5 Excel files per year.
    How to maintain all the files and how to retrieve.(download..)</i>
    --> Based on the requirement, design the key fields..For example, like Employee Number + month+year..
    <b>FOr Downloading from Ztable & show excel:</b>
    <b>For downloading to a spread sheet:</b>
    Convert your fetched data to a string and convert to XSTRING format and finally download to a spread sheet.
    <b>Add this code in Oninoutprocessing:</b>
    <b>Sample:</b> Select the stored String data from Ztable keep it in internal table.
    data : v_string type string, v_xstring type xstring.
    loop at itab into wa.
    v_string =  wa-file_content.
    endloop.
    *All the data is now in string format. Calling the FM to convert to XSTRING
    call function 'SCMS_STRING_TO_XSTRING'
    exporting
    text = v_string
    mimetype = 'APPLICATION/MSEXCEL; charset=utf-16le'
    (probably create this in a variable and call here)
    importing
    buffer = v_xstring.
    concatenate cl_abap_char_utilities=>byte_order_mark_little v_xstring into v_xstring in byte mode.
    *Now we have it in XSTRING format - this can be downloaded to a spread sheet.
    v_appl = 'APPLICATION/MSEXCEL; charset=utf-16le'.
    runtime->server->response->set_header_field( name = 'content-type' value = v_appl ).
    * Eliminating the cache problems when loading Excel Format
    runtime->server->response->delete_header_field( name = if_http_header_fields=>cache_control ).
    runtime->server->response->delete_header_field( name = if_http_header_fields=>expires ).
    runtime->server->response->delete_header_field( name = if_http_header_fields=>pragma ).
    * Start excel in a separate window
    runtime->server->response->set_header_field( name = 'content-disposition' value = 'attachment; filename=Order_list.xls' ).
    * Displaying the data in excel.
    v_len = xstrlen( v_xstring ).
    runtime->server->response->set_data( data = v_xstring length = v_len ).
    navigation->response_complete( ).
    Raja T

  • Problems with fileUpload

    Hi,
    I'm using JDeveloper 11g, integrated WLS and ADF Faces. I've implemented fileUpload functionality just like this tutorial says:
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/devguide/fileupload.html
    I've tried using adf-faces-impl-1013.jar and adf-faces-api-1013.jar but I'm always getting errors:
    Sep 8, 2009 2:13:03 PM JpsApplicationLifecycleListener Migrate Application Credential Store
    WARNING: Overwriting credentials is allowed in application credential store migration with Weblogic server running in Development Mode and system property 'jps.app.credential.overwrite.allowed' set to true
    Sep 8, 2009 2:13:09 PM oracle.adfinternal.view.faces.renderkit.core.CoreRenderKit _addBasicHTMLRenderKit
    WARNING: Could not find basic HTML renderer for family javax.faces.Command, type=javax.faces.Button
    SEVERE: zip:C:/Documents and Settings/user/Application Data/JDeveloper/system11.1.1.1.33.54.07/DefaultDomain/servers/DefaultServer/tmp/_WL_user/Prijava/f17v7y/war/WEB-INF/lib/adf-faces-impl-1013.jar!/META-INF/agent/capabilities.xml: Parsing error, line 2, column 89:
    org.xml.sax.SAXParseException: Invalid Namespace: http://xmlns.oracle.com/adf/view/faces/agent/capabilities
    at org.apache.myfaces.trinidadinternal.agent.parse.CapabilitiesDocumentParser.startElement(CapabilitiesDocumentParser.java:114)
    at org.apache.myfaces.trinidadinternal.share.xml.TreeBuilder$Handler.startElement(TreeBuilder.java:333)
    at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1324)
    Sep 8, 2009 2:13:17 PM org.apache.myfaces.trinidad.component.UIXComponentBase _createType
    SEVERE: Could not load type properties
    java.lang.NullPointerException
    at sun.jkernel.DownloadManager.getBootClassPathEntryForClass(DownloadManager.java:928)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:293)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:300)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:300)
    Sep 8, 2009 2:13:18 PM org.apache.myfaces.trinidadinternal.share.xml.TreeBuilder$Handler _logError
    SEVERE: META-INF/adf/styles/simple-desktop.xss: Parsing error, line 4, column 35:
    org.xml.sax.SAXParseException: No org.apache.myfaces.trinidadinternal.style.xml.parse.StyleSheetDocument parser registered for top element;check your namespace declaration. Namespace: http://xmlns.oracle.com/uix/style
    Local name: styleSheetDocument)
    at org.apache.myfaces.trinidadinternal.share.xml.TreeBuilder$Handler.startElement(TreeBuilder.java:259)
    at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1324)
    at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:368)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:314)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:225)
    Sep 8, 2009 2:13:18 PM org.apache.myfaces.trinidadinternal.skin.StyleSheetEntry _createStyleSheetDocument
    SEVERE: Could not load style sheet: META-INF/adf/styles/simple-desktop.xss
    Sep 8, 2009 2:13:18 PM org.apache.myfaces.trinidadinternal.skin.StyleSheetEntry _createStyleSheetDocument
    SEVERE:
    org.xml.sax.SAXParseException: No org.apache.myfaces.trinidadinternal.style.xml.parse.StyleSheetDocument parser registered for top element;check your namespace declaration. Namespace: http://xmlns.oracle.com/uix/style
    Local name: styleSheetDocument)
    at org.apache.myfaces.trinidadinternal.share.xml.TreeBuilder$Handler.startElement(TreeBuilder.java:259)
    at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1324)
    at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:368)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:314)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:225)
    I've also tried using adf-faces-impl-ea15.jar and adf-faces-api-ea15.jar, the error was:
    java.lang.ClassNotFoundException: oracle.adfinternal.view.faces.taglib.validator.ValidatorTag
    Could someone please tell me which adf-faces-impl.jar and adf-faces-api.jar should be used for fileUpload and where can I find it?
    Thanx,
    Jelena

    Jeelena,
    you don't need any additional jar files to do file uploading. Read [url http://download.oracle.com/docs/cd/E15051_01/web.1111/b31973/af_input.htm#BABDFAEI]here for the current version of the docs.
    John

  • Problems with FileUpload Demo

    Hi!, i have a problem with the File Upload Demo when it calls this line:
    hDirectoryObject := JFile.new(directory);
    and the error is: error 6508 "PL/SQL: could not find program unit being called"
    That's ok, but anybody knows why should the program couldnt find the routine ?
    And just one more thing...where can i look for JFile method description ??
    Thanks a lot :) !!
    Cristian.

    Hi!, i have a problem with the File Upload Demo when it calls this line:
    hDirectoryObject := JFile.new(directory);
    and the error is: error 6508 "PL/SQL: could not find program unit being called"
    That's ok, but anybody knows why should the program couldnt find the routine ?
    And just one more thing...where can i look for JFile method description ??
    Thanks a lot :) !!
    Cristian.

  • Problem in FileUpload UI element

    Hi All,
           I have done all the operations that are there in this lilnk of FileUpload UI element and I am giving the link also
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f5d3c40a-0801-0010-55b7-9e3b01745a40
    Here, Web Dynpro runtime automatically transports different types of MIME files between the client-side user interface or UI element and the server-side controller context.
      Now I have to take that file from server-side conroller
    context and I have to place that file into my desired server path.
      please help me regarding this issue.
    Thanks All

    Hi,
    When u create FileOutputStream object, u can specify the location where u want to place the file in the server. If the file is already in the server, create a FileInputStream object of that file and copy that file in a new location in the server.
    Regards,
    Piyush.

  • Facing Problem with FileUploading.....

    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    import org.apache.commons.fileupload.*;
    public class FileUploadDemo extends HttpServlet
         public void init(ServletConfig config) throws ServletException
         public void doPost(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
              res.setContentType("text/html");
              PrintWriter pw=res.getWriter();
              String str=null;
              String value=null;
              String name1=null, dob=null, grad=null,exp=null,loc=null;
              int passport=0, age=0;
              File uploadFile=null;
              try{
                        DiskFileUpload upload=new DiskFileUpload();
                        List items=upload.parseRequest(req);
                        Iterator iter=items.iterator();
                        while(iter.hasNext())
                             FileItem item=(FileItem)iter.next();//This class represents a file or form item that was received within a multipart/form-data POST request.
                             if(item.isFormField())
                                  String name=item.getFieldName();
                                  if(name.equals("name"))
                                       name1=item.getString();
                                  if(name.equals("age"))
                                       age=Integer.parseInt(item.getString());
                                  if(name.equals("passport"))
                                       passport=Integer.parseInt(item.getString());
                                  if(name.equals("dob"))
                                       dob=item.getString();
                                  if(name.equals("grad"))
                                       grad=item.getString();
                                  if(name.equals("exp"))
                                       exp=item.getString();
                             }//if
                             else
                                  System.out.println("in file upload");
                                  loc="c:\\"+exp+"\\"+passport+".doc";
                                  uploadFile=new File(loc);
                                  item.write(uploadFile);
                        }//while
                        }//try
                        catch(Exception e)
                             e.printStackTrace();
         }//do
         public void destroy()
              System.out.println("Destroy method called");

    This doesn't seem to have anything to do with JavaMail.
    Maybe you should ask your question in a Tomcat or servlet
    support forum?

  • Problem in Fileupload utility ora-06508

    Dear all ,
    i downloaded the demo of oracle file upload utility and i applied all the steps of insalling it
    but when i run it , it gives me the following error ( ora-06508)
    can any one help me in solving this problem

    i downloaded the demo of oracle file upload utility...Where did you download this demo from? Is this and Oracle product or a 3rd party?
    ...and i applied all the steps of insalling it but when i run it , it gives me the following error ( ora-06508) >
    Please show us your code. Without this we are blind to what you are doing.
    Also, we need to know your Forms version. It is better to give us too much information than not enough.
    Craig...

  • Problem with fileupload

    I am not able to upload large file (greater than 4MB) using the ADF. I have used the ADF provided file upload mechanism and at the time of uploading a validation from ADF occurs (THE UPLOADED FILE IS TOO LARGE). Is there any mechanism to increase the maximum file size.
    Please advise..
    Jeethy

    Depending upon whether you are using JDev 10 or 11, you will either set
    oracle.adf.view.faces.UPLOAD_MAX_DISK_SPACE or org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE in your web.xml file. It's in the documentation for af:inputFile.
    John

  • Problem with FileUpload with Struts

    Hello,
    Here is my form I've created :
    <html:form action="/UploadFile.do" method="post" enctype="multipart/form-data">
    <html:file property="file" />
    </html:form>
    The form I submit conatins a "file" attribute of FileForm type.
    I did exatcly as mentionned in different tutorials to upload files with Struts.
    But I get the following exception and I can't figure out what's happening:
    javax.servlet.ServletException: BeanUtils.populate
    at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254)
    java.lang.IllegalArgumentException: argument type mismatch
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    Please Help !
    I'm using Struts 1.1 by the way
    Thank your for your help
    Hugo

    What is in the form bean you're using? You need a field that holds a FormFile object:
    import org.apache.struts.upload.*;
         private FormFile file;
         public FormFile getFile() {
              return this.file;
         public void setFile(FormFile file) {
              this.file = file;
    ...

  • FileUpload and special characters problem

    Dear all,
    I currently encounter a issue with the FileUpload module.
    In my user form I have a FileUpload module to enable the user to upload a certificate file. The module itself is working fine but when the user controls an organisation containing a special character (like ñ), I cannot save the form because of the following error :
    ( ) - Warning: Parenthesized values in field 'accounts[Lighthouse].controlledOrganizations' do not match any of the allowed values.
    No controlled organisation is parenthesized.
    If I remove the FileUpload module, there is no error and I can save the user.
    If I change the type of the FileUpload module to Text, there is no error and I can save the user.
    I have two environments with this problem and two other without but the forms are identical, the java classes are the same. I do not see what would be able to cause this behaviour.
    Do you have any idea how to fix this ?
    It looks like the issue reported in this thread Problem using FileUpload Class Element/ encoding/ umlaut problem
    Thanks

    Try to use parameters instead hardcoding values in the queries:
    select * from user where lower(username)=?;
    and don't forget to lower the value from java side as well ;-)

  • FileUpload problem

    Hello all,
    I'm using the FileUpload component in a JSPDynPage but it does not seem to work for me. The problem is a lot like the one Patrick O'Neill asked about. I used the HTMLB example but for some strange reason variable fu remains NULL. Please have a look at my code and explain to me what the problem is. The JSP contains a file upload component and a button to start the upload event.
    This is the java code I used (testprogram):
    import com.sapportals.htmlb.enum.ButtonDesign;
    import com.sapportals.htmlb.event.Event;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.portal.htmlb.page.JSPDynPage;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    import com.sapportals.portal.prt.component.IPortalComponentContext;
    import com.sapportals.portal.prt.component.IPortalComponentProfile;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    // for htmlb upload
    import java.io.File;
    import com.sapportals.htmlb.rendering.IFileParam;
    import com.sapportals.htmlb.FileUpload;
    // for debugging
    import com.sapportals.portal.prt.runtime.PortalRuntime;
    import com.sapportals.portal.prt.logger.ILogger;
    import com.sapportals.portal.prt.logger.Level;
    import bean.FileUploadBean;
    public class FileUploadExample extends PageProcessorComponent {
        public DynPage getPage() {
            return new RealJSPDynPage();
        public class RealJSPDynPage extends JSPDynPage {
              FileUploadBean myBean;
              private ILogger defaultLogger = PortalRuntime.getLogger();
            public RealJSPDynPage() {
            public void doInitialization() {
                   // Get the request, context and profile from portal platform
                    IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
                    IPortalComponentContext myContext = request.getComponentContext();
                    IPortalComponentProfile myProfile = myContext.getProfile();
                   defaultLogger.setActive(true);
                   defaultLogger.setLevel(Level.ALL);
                    // Initialization of bean
                    FileUploadBean myBean = new FileUploadBean();
                    setBeanFromProfile(myProfile, myBean);
                    // Put the bean into the application context
                    myContext.putValue("myBeanName", myBean);
            public void doProcessAfterInput() throws PageException {
                   // Get the request, context and profile from portal platform
                    IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
                    IPortalComponentContext myContext = request.getComponentContext();
                    IPortalComponentProfile myProfile = myContext.getProfile();
                    // Get the bean from application context
                    myBean = (FileUploadBean) myContext.getValue("myBeanName");
                    setBeanFromProfile(myProfile, myBean);
             public void doProcessBeforeOutput() throws PageException {
                        setJspName("fileupload.jsp");
              public void onClick(Event event) throws PageException {
                   myBean.setText("I was clicked");
                 String ivSelectedFileName;
                   FileUpload fu = (FileUpload) this.getComponentByName("myfileupload");
                   // debug info message, other option is: severe
                   defaultLogger.info(this, "Hello this is a test");
                   if (fu == null) {
                        // error
                        defaultLogger.severe(this, "strange error");
    //       this is the temporary file
                   if (fu != null) {
    //       Output to the console to see size and UI.
                      System.out.println(fu.getSize());
                      System.out.println(fu.getUI());
                      defaultLogger.info(this, String.valueOf(fu.getSize()));
                      defaultLogger.info(this, fu.getUI());
    //       Get file parameters and write it to the console
                      IFileParam fileParam = fu.getFile();
                      System.out.println(fileParam);
    //       Get the temporary file name
                      File f = fileParam.getFile();
                      String fileName = fileParam.getFileName();
                      defaultLogger.info(this, fileName);
    //       Get the selected file name and write ti to the console
                      ivSelectedFileName = fu.getFile().getSelectedFileName();
                      System.out.println("selected filename: "+ivSelectedFileName);
                      defaultLogger.info(this, "selected filename: "+ivSelectedFileName);
              private void setBeanFromProfile(IPortalComponentProfile myProfile, FileUploadBean myBean) {
                        // FileUpload properties
                        myBean.setSize(myProfile.getProperty("size"));
                        myBean.setMaxLength(myProfile.getProperty("maxLength"));
                        myBean.setAccept(myProfile.getProperty("accept"));
                        // Button properties
                        myBean.setDisabled(myProfile.getProperty("disabled"));
                         myBean.setDesign(ButtonDesign.getEnumByString(myProfile.getProperty("design")));
                         myBean.setEncode(myProfile.getProperty("encode"));
                         myBean.setText(myProfile.getProperty("text"));
                         myBean.setTooltip(myProfile.getProperty("tooltip"));
                         myBean.setWidth(myProfile.getProperty("width"));
    This is the JSP:
    <%--- FileUpload.jsp --%>
    <%@ taglib uri= "tagLib" prefix="hbj" %>
    <%--- Get the Bean named myBeanName from the application context --%>
    <jsp:useBean id="myBeanName" scope="application" class="bean.FileUploadBean" />
    <hbj:content id="myContext" >
      <hbj:page title="Template for a portal component">
       <hbj:form id="myFormId" encodingType="multipart/form-data">
         <hbj:fileUpload
                      id="myFileUpload"
                      size="<%=myBeanName.getSize() %>"
                      maxLength="<%=myBeanName.getMaxLength() %>"
                      accept="<%=myBeanName.getAccept()%>">
         </hbj:fileUpload>
         <hbj:button
              id="MyButton"
              text="<%=myBeanName.getText() %>"
              width="<%=myBeanName.getWidth() %>"
              tooltip="<%=myBeanName.getTooltip() %>"
              onClick="click"
              design="<%=myBeanName.getDesign().getStringValue() %>"
              disabled="<%=myBeanName.isDisabled() %>"
              encode="<%=myBeanName.isEncode() %>">
         </hbj:button>
       </hbj:form>
      </hbj:page>
    </hbj:content>
    The Bean:
    package bean;
    import com.sapportals.htmlb.enum.ButtonDesign;
    public class FileUploadBean
         // FileUpload
         public String size;
         public String maxLength;
         public String accept;
         public String getSize() {
              return size;
         public void setSize(String size) {
              this.size = size;
         public String getMaxLength() {
              return maxLength;
         public void setMaxLength(String maxLength) {
              this.maxLength = maxLength;
         public String getAccept() {
              return accept;
         public void setAccept(String accept) {
              this.accept = accept;
         // Button
         public String disabled;
         public ButtonDesign design;
         public String encode;
         public String text;
         public String tooltip;
         public String width;
         // constructor
    //     public ButtonBean() {
         public String isDisabled() {
              return disabled;
         public void setDisabled(String disabled) {
              this.disabled = disabled;
         public ButtonDesign getDesign() {
              return design;
         public void setDesign(ButtonDesign design) {
              this.design = design;
         public String isEncode() {
              return encode;
         public void setEncode(String encode) {
              this.encode = encode;
         public String getText() {
              return text;
         public void setText(String text) {
              this.text = text;
         public String getTooltip() {
              return tooltip;
         public void setTooltip(String tooltip) {
              this.tooltip = tooltip;
         public String getWidth() {
              return width;
         public void setWidth(String width) {
              this.width = width;
    and the Portalapp.xml
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="startup" value="true"/>
        <property name="SharingReference" value="htmlb"/>
      </application-config>
      <components>
        <component name="FileUpload">
          <component-config>
            <property name="ClassName" value="FileUploadExample"/>
            <property name="SecurityZone" value="com.sap.portal.pdk/low_safety"/>
          </component-config>
          <component-profile>
            <property name="maxLength" value="125000">
              <property name="personalization" value="dialog"/>
            </property>
            <property name="accept" value="Accept">
              <property name="personalization" value="dialog"/>
            </property>
            <property name="size" value="50">
              <property name="personalization" value="dialog"/>
            </property>
            <property name="width" value="250">
              <property name="personalization" value="dialog"/>
              <property name="type" value="number"/>
            </property>
            <property name="disabled" value="FALSE">
              <property name="personalization" value="dialog"/>
              <property name="type" value="boolean"/>
            </property>
            <property name="encode" value="True">
              <property name="personalization" value="dialog"/>
              <property name="type" value="boolean"/>
            </property>
            <property name="tooltip" value="Initial Tooltip">
              <property name="personalization" value="dialog"/>
            </property>
            <property name="text" value="Initial Button Text">
              <property name="personalization" value="dialog"/>
            </property>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
            <property name="design" value="STANDARD">
              <property name="personalization" value="dialog"/>
              <property name="type" value="select[STANDARD,SMALL,EMPHASIZED]"/>
            </property>
          </component-profile>
        </component>
      </components>
      <services/>
    </application>

    Hi Raymond,
    within your JSP, you have given the ID "myFileUpload" whereas within your coding you try to retrieve a component with ID "myfileupload". That's all so far.
    Some additinal hints:
    When referring to another thread, please give the link; in this case, you talked about Problem with FileUpload component
    If you give (non) working examples, please reduce them to an absolute minimum, so that they show what they should show, but nothing more. This does not only hold on SDN but for all bug tracking systems. People get ill from reading 1000 lines of code where 10 would do
    And for formatting on SDN, you can use [ code ] and [/ code ] (without spaces), makes life easier too.
    And don't forget to press the yellow star button on helping answers...
    So far for today
    Hope it helps
    Detlev

  • FileUpload: writing path problem

    Hi everybody,
    I have a little problem with FileUpload.
    When I used 'Browse' button for finding file. Path is written into Context. And I can upload selected file with using context.
    but instead of using 'Browse' button, if I write path into textedit element. It doesn't work. How can I fix it.

    Hi,
    I’m having a similar problem with the <i>FileUpload element</i>, with the difference that the page doesn’t respond when I write something into the InputField <i>element</i> (that comes with the FileUpload element) without a <b>“\”</b>. In other cases I’m able to catch the exception (if it isn’t a valid path) and give a message to the user.
    I understand the correct way of using the <i>FileUpload element</i> is with the help of the <i>browse button</i>, but I need to cover any mistake the user can make. Is there anything I can do?
    Thanks

  • File Upload using WD ABAp

    HI,
       I am working with a File Upload Web Dynpro Application. And i am using the File Upload UI Element to do this, every thing works fine.. i upload the file and show the error records in the other page.. and in the second page i have a back button, when i press the back button it should come to the first page . But the problem here is when ever i come back to first page from second page, the file path that i already selected is not visible in the file upload UL element , how ever the file name is still available in the context attribute that this FILE UI element is binded to..
    One more thing that i have observed with this control is i am not able to set a default value to this say 'c:\'.
    Is there any property that also me to have this defualt value and the value persistance for this UI..
    or.
    could you please suggest the other ways of doing this file upload withoout using the File Upload Control.
    Thanks
    Mahesh

    This is actually problem with FileUpload element in WebDynpro which is because of IE and not even in control of WDA.
    For more details plz check the below link
    http://help.sap.com/saphelp_nw70/helpdata/en/b3/be7941601b1d09e10000000a155106/frameset.htm
    I am pasting the detail here.
    Technical Browser Details Beyond the Control of WDA
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Due to browser restrictions that are unrelated to Web Dynpro ABAP, the previously entered data path might disappear when a FileUpload UI element is clicked. In newer versions of the browser, it is therefore impossible to enter the file name in the entry field. The field always remains empty. For more details, read the security-related information in Internet Explorer 6 about handling <input type=file>.
    The path might also disappear if an incorrect path name is entered in this field. This also has to do with security aspects in the browser. For security reasons, the browser only accepts absolute paths or a pack selection via the Browse… key. If the path name is incorrect, the browser will not even forward the request.
    The FileUpload of WebDynpro is very Primitive.
    I dont think there are methods to set filters and initial path. Please let me know if you are able find a way.
    Thanks,
    Anand

  • FileUplaod UI : Object could not be found in cache, key is null!

    Hi,
    I get problem using FileUpload UI Element.
    When I select a file (any file .) and push a button (uplaod bt), I get an error message below the FileUpload UI:
    ==>  Object could not be found in cache, key is null!
    There is something odd cause in the event linked to my upload button the function is completly emtpy. So it is not o Code error. And of course I've make the context attribute Modifiable :
    IWDModifiableBinaryType type = (IWDModifiableBinaryType) wdContext.getNodeInfo().getAttribute(IPrivateExternalOrderCompView.IContextElement.FILE_RESOURCE).getModifiableSimpleType();
    Any Idear ?
    Regards,

    Hi,
    Ok guys thanks for your answers, I fixed my problem.
    The thing was I missused simple modify type.
    So here is what I'm doing :
    In my context View :
    file type : Binary
    wdInit of the View :
    IWDAttributeInfo attInfo = wdContext.getNodeInfo().getAttribute(IPrivateExternalOrderCompView.IContextElement.FILE);
              ISimpleTypeModifiable type = attInfo.getModifiableSimpleType();
              IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType) type;
    That's it !
    Everything goes good.
    Thanks
    Regards,

Maybe you are looking for

  • AirPlay and Remote no longer working after 6.1 update.

    After updating my Apple TV to iOS 6.1 I am no longer able to connect to it via AirPlay (from iPad or iTunes) or even control it with Remote.app on my iPad. After hard restarting it (by unplugging it) I am able to, until it goes to sleep, after which

  • Fill in blank cells of a Pivot Table Value field area

    Hi, In this workbook (http://1drv.ms/1oHk0QV), a normal Pivot Table has been created on the "Pivot Table" worksheet.  I'd like the blank cells of the Pivot Table to be filled up with the preceding non blank value.  So to take an example of Product A,

  • Camera Raw / smart object ?

    Using CS3 / CR / Bridge Scenario: I've shot 500 wedding images, sorted & edited them in Bridge. Now I'll look at each one in camera raw (in Bridge) and make any needed adjustments. I use CR and adjust / sync as many similar files as I can; zipping th

  • Greyed out .MOV HELP!

    This isnt specifically FCPX, but I assume most people here have greater experience with media files. I recently shot a 2 camera Biography interview and my final and most critical clip is greyed out in the "Finder" window. I have tried other macs, dro

  • Need a tool for oracle,like we have in sqlserver profiler....

    Hi All, I need your help..I need a graphical tool for oracle for monitoring the queries which are hitting the database.Actulla our developers wants this tool.Please advice me in this ASAP We have a tool profiler in sqlserver,we need the tool which wo