htmlb:fileUpload in BSP

Hi,
Iam uploading an Excel file from the local PC using the <htmlb:fileUpload>
I wanted to read this uploaded file and create a document with the data in the cells on the excel. When iam trying to read i get the data in numbers.
any ideas to read the uploaded file.
Thanks,
Shailaja

Hi Shailaja
please try CL_HTMLB_MANAGER=>GET_DATA. For BSP related question you should search in the Business Server Pages (BSP).
Regards
Gregor

Similar Messages

  • Maximum file size using htmlb:fileUpload

    Hello Gurus,
    in a bsp application we are using htmlb:fileUpload. It was possible to upload a 43 MB file without problem. But our maximum file size is about 220 MB. We made a test with a 190 MB file. After we hit the post button, the browser disconnects immediately (without timedelay) with the message: page cannot be displayed.
    for me it looks like we hit some restriction.
    any idears how to manage the 220 MB file in the browser beside splitting it into smaller files would be greatly appreciated.
    thx a lot in advance and regards from
    Michael

    Hello again,
    could it be this parameter which is for the limitation responsible ?
    icm/HTTP/max_request_size_KB   = 102400
    thx and best regards from Michael

  • Htmlb:fileupload

    Hi Gurus,
    In my custom BSP I'm using Htmlb element fileupload in the following way..
    <htmlb:fileUpload id          = "myFile"
                              accept      = "true"
                              size        = "50" />
    I'm able to select only a single file when I browse for files. How should I acheive seleting multiple files ?
    Thank you
    Sreesanth

    Hello Sreesanth,
    If you want ot upload more than one file, use <htmlb:fileUpload> that many times.
    Rgds,
    Jothi.P
    **reward and close the thread if useful.

  • Htmlb:fileUpload = page connot be displayed

    I just tried to use a this item:
    <htmlb:fileUpload id="att_upload" size = "50" />
    However, as soon as I instert that item into my BSP page and try to start it (F8), i get an "page connot be displayed" error in the browser. does anybody know how to use that (or another similar) item?
    thx

    Hi Daniel,
    please try the following:
    open your browser, click on Tool -> Internet Options
    and then on the tabstrip 'Advanced'. Uncheck both entries starting with "Show friendly". Try to start your BSP again. You will get a more technical error message. This can be helpful in finding the error.
    Regards,
    Rainer

  • htmlb:fileupload goes into infinite loop

    Hello all,
    We use the tag <htmlb:fileupload> in our bsp page. Now if the user enters a file name directly, ie:without using the browse button the user simply enters a filename, say 'Resume.doc' in the input field and hits the save button on the page, then the system is going into an infinite loop and the system hangs, the users cannot proceed further and they need to restart the browser all over again(it is not necessary that the file must exist in the system, the user just types in a file name and performs the save action). This is a cause of concern for some of our customers, they expect that we should provide a meaningful message to the user and the processing should end. Is this a known issue in BSPs ?? Can anyone suggest me how to get rid of this problem ?
    Thanks and Best Regards,
    Viqar Ali.

    Hello All,
    I use the following code in my bsp:
    <phtmlb:matrix width="100%" >
      <phtmlb:matrixCell row = "1"
                         col = "1" />
        <phtmlb:formLayout design           = "HEADING_ONLY_SOLID"
                           customizationKey = "<%= controller->context %>" >
        <%-- Upload --%>
        <phtmlb:formLayoutItem label    = "<%= controller->file_label %>"
                               idOfItem = "upload" >
          <htmlb:fileUpload id   = "upload"
                            size = "30" />
        </phtmlb:formLayoutItem>
    Everything works fine if the user selects a file using the browse button to select a file. Instead if the user enters a file name directly, then the system runs into an infinite loop. I have put a breakpoint in DO_HANDLE_DATA & DO_REQUEST of the controller class. However the control doesnt come till this point also and i cannot even debug anything. The breakpoints are hit if the user selects the file using the browse button. If anyone has a similar scenario working correctly in their application pls update me with the code.
    Thanks and Best Regards,
    Viqar Ali.

  • How to hide htmlb fileUpload

    Hi all,
    If i have not authorization to upload a file then  i need to hide the element htmlb fileUpload . How can i do it?. Thanks in advance.
    Gab.

    Hi Gab,
    check this link
    upload file via BSP
    cheers,
    Bhavana

  • Com.sapportals.htmlb.FileUpload;

    Hi Experts,
    I am building this file upload utility.
    Following is my code"
    package com.xyz.ws.di;
    import java.io.Serializable;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import com.sapportals.htmlb.event.Event;
    import com.sapportals.htmlb.rendering.IPageContext;
    import com.sapportals.htmlb.rendering.PageContextFactory;
    import com.sapportals.htmlb.FileUpload;
    import com.sapportals.portal.prt.component.*;
    import com.sapportals.wcm.repository.AccessDeniedException;
    import com.sapportals.wcm.repository.Content;
    import com.sapportals.wcm.repository.ICollection;
    import com.sapportals.wcm.repository.IResource;
    import com.sapportals.wcm.repository.NotSupportedException;
    import com.sapportals.wcm.repository.ResourceContext;
    import com.sapportals.wcm.repository.ResourceException;
    import com.sapportals.wcm.repository.ResourceFactory;
    import com.sapportals.wcm.util.uri.RID;
    import com.sapportals.portal.security.usermanagement.IUser;
    public class FileUpload implements Serializable{
             protected IPortalComponentRequest request;
              protected IPortalComponentResponse response;
              protected IPortalComponentSession session;
              protected IPortalComponentContext context;
              protected IPortalComponentProfile profile;
              protected String userId;
              protected String fileName;
              private DAO DAO = null;
              private final static int INITIAL_STATE = 0;   
              private final static int ERROR_STATE = 1; 
              private int state = INITIAL_STATE;
              public void uploadUtility(IPortalComponentRequest request, IPortalComponentResponse response)
                   String mimetype;
                   String resourceName;
                   String repository;
                   FileInputStream sourceFileInput = null;
                   session = request.getComponentSession();
                   DAO = new DAO();
                   DAO = (DAO)session.getValue("DAO");
                   IUser epUser=DAO.getEpUser();
                   System.err.println("berry + Getting Iuser from inside UploadUtility SAI  " + epUser);
              /*     IWDClientUser wdUser = WDClientUser.getCurrentUser();
                   IUser user = wdUser.wdUser.getSAPUser(); */
              //     IUser epUser=(IUser)request.getUser().getUser();
                   System.err.println("epUser - " + epUser);
                   ResourceContext ctx = new ResourceContext(epUser);
                   repository = "/Folder1/new";
                   RID rid=RID.getRID(repository);
                   System.err.println("getting RID :- " + rid);
                   IPageContext context = PageContextFactory.createPageContext(request,response);
              //     PageContext context = PageContextFactory.createPageContext(request, response);
                   Event event=context.getCurrentEvent();
                   if(null!=event)
                        String event_name=event.getAction();
                        if(null!=event_name && event_name.trim().equalsIgnoreCase("upload_file"))
                              FileUpload fileUpload = (FileUpload)context.getComponentForId("fileupload");
                                  if(null !=fileUpload && null!=fileUpload.getFile())
                                            mimetype = fileUpload.getFile().getContentType();
                                            resourceName = fileUpload.getFile().getFileName();
                                            System.err.println("resourceName inside fileUploadUtility :- " + resourceName);
                                            //sourceFileInput = new FileInputStream(fileUpload.getFile().getFile().getAbsolutePath());
                                            fileName = resourceName;
                                            System.err.println("filename :- " + fileName);
                                            try {
                                                 sourceFileInput = new FileInputStream(fileUpload.getFile().getFile().getAbsolutePath());
                                            } catch (FileNotFoundException fnf) {
                                                 state = ERROR_STATE;
                                                 System.err.print("FileNotFoundException Occured " + fnf.toString());
                                            Content content = new Content(sourceFileInput, mimetype, -1L);
                                            IResource resource = null;
                                            try {
                                                 resource =(IResource) (ResourceFactory.getInstance().getResource(rid, ctx));
                                            } catch (ResourceException resexp) {
                                                 state = ERROR_STATE;
                                                 System.err.print("Resource Exception Occured for IResource" + resexp.toString());      
                                            ICollection aCollection=(ICollection)resource;
                                            //IResource newResource = aCollection.createResource(resourceName, null, content);
                                            try {
                                                 IResource newResource = (IResource) aCollection.createResource(resourceName, null, content);
                                            } catch (NotSupportedException e2) {
                                                 state = ERROR_STATE;
                                                 System.err.print("Not Supported Exception Occured" + e2.toString());
                                            } catch (AccessDeniedException e2) {
                                                 state = ERROR_STATE;
                                                 System.err.print("Access Denied Exception Occured" + e2.toString());
                                            } catch (ResourceException e2) {
                                                 state = ERROR_STATE;
                                                 System.err.print("Resource Exception Occured for ICollection" + e2.toString());      
                                            }//end of catch
                             }//end of innermost if
                   }//end of 2nd if
              }//end of 1st If
              DAO.setFileName(fileName);
              DAO.setState(state);
              session.putValue("DAO", DAO);
           }// end of uploadUtil
    I am getting a complie error in my NWDS at the following line:
    FileUpload fileUpload = (FileUpload)context.getComponentForId("fileupload");
    The error is : Cannot cast from component to FileUpload.
    Also, I am getting an error on the following Import statement:
    import com.sapportals.htmlb.FileUpload;
    The error is : The import import com.sapportals.htmlb.FileUpload conflicts with a type defined in the same file.
    Any Idea why this would be happening?
    Thanks
    S.B

    import com.sapportals.htmlb.FileUpload;
    is conflicting with the class name. Both are same.
    Change the class name.
    Thread closed.

  • Set default file for htmlb:fileUpload ?

    I use htmlb:fileUpload to let the user select a file from the file system.
    Is it possible to write a start value into the textbox??
    For example, I'd like to write "C:\Windows\text.txt" into the inputField when the page is first shown.

    <i>> I'd like to write "C:\Windows\text.txt"</i>
    In short words: this is not allowed because it is not secure.
    Nobody but user itself can changer something in the file upload control.
    Consider the example
    <fileupload default="C:\Windows\passwords.etc">
    and autosubmit

  • htmlb:fileUpload - Upload any type file to an R/3 Server using BSP?

    Hi All,
    Can anyone help me with the subject mentioned problem? I went through the following thread, but Thomas's reply was not clear enough to me- [File Inputfield - ABAP functions to store files?|File Inputfield - ABAP functions to store files?]
    Thanks in advance.
    Regards
    Gladson

    John,
    You are looking for File -XI-RFC scenario right, please follow the below weblog
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit
    If you need more details, reply!!!!
    Best regards,
    raj.

  • Why to use htmlb elements in bsp applications

    Hi All,
       I have a doubt that why to use htmlb elements for implementing user interface in bsp applications .Implementing bsp application using htmlb is difficult than html because we have handle event triggering in oninputprocessing but this is not required in html.Can anybody help me out in understanding the advantages of htmlb over html. 
    Thanks in Advance......

    Dear Srilalitha
    Re: Why htmlb is prefered to normal html code ?
    Please go thorught this. This will surely help.
    Regards
    Vijay.M

  • Handling HTMLB events in BSPs???

    Hi all,
    can anybody tell me the how to handel events in BSPs??

    Hi Aravind,
    Follow the link  /people/brian.mckellar/blog/2004/07/28/bsp-programming-handling-htmlb-events u can understand.

  • }HTMLB FileUpload - Javascript

    Hi SDN,
    I am using
    <hbj:fileUpload id="myfileupload"   />
    in my jsp. I wanted to process the file that is to be uploaded in my javascript. There is no 'jsObjectNeeded'  attribute for the fileUpload UI element. How can I achieve this with SAP not supporting JS for this UI...any other round about way???
    Please let me know...
    Thanks & Regards,
    p188071

    Check this might hlep u
    Thread
    http://www.sapdesignguild.org/resources/htmlb_guidance/fileupload_dev.html
    PDF
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8a41cee4-0601-0010-5fb3-d8e704f88817?overridelayout=true
    Thanks

  • Problems with htmlb:fileUpload

    Hi, I am trying to implement a JSPDynPage which uses the
    fileUpload-Tag. In most cases it works fine but sometimes I can select a file but the next button click (onWork) event is not send to the server.
      <hbj:form id="myForm" encodingType="multipart/form-data">
      <hbj:formLayoutCell id="cf_fimport_2" align="center"  valign="TOP" width="175">
         <hbj:fileUpload id="upload" size="30" accept="plain/text"/>
      </hbj:formLayoutCell>
    and the button is defined
    <hbj:formLayoutCell id="cf_fimport_5" align="right" paddingRight="7">
      <hbj:button id="bpreview" text='doWork' design="STANDARD" disabled="false"
    onClick="work"/>
    </hbj:formLayoutCell>
    The page is refreshed but no action is done.
    Any idea?
    Is there a bit more documentation about the fileUpload-Tag ?
    Environment:
    Windows XP
    SAP EP6 SP4 Sneak Preview
    IE 6.0
    Regards
    Edmund

    Dear Edmund.
    I've exactly the same problem.
    In details:
    Prerequisites:
    1) there is <hbj:fileUpload ...> tag on the jsp.
    2) The form is declared as <hbj:form id="....." encodingType="multipart/form-data">
    3) There is defined button with handled event e.g. "onButtonClicked"
    4) The user will insert any file to the tag
    Behavior:
    1) The request does NOT consist ANY components. ( I can see in the log )
    2) The method "onButtonClicked" is NOT called.
    3) Randomly - there is onInitialization() method called.
    As it was mentioned by You, the older versions of portal works with the hbj:fileUpload correctly.
    I will be very pleased with someone explaining the problem.
    Regards Best
    Marek
    P.S.Very interesting fact: when <the hbj:fileUpload> is empty the request is sent properly - with all the components.

  • Htmlb:fileUpload: change "browse" button to another language

    I have a simple fileUpload Tag that shows a inputField and a "Browse" Button. In my Browser-Settings, the language is German, so instead of "Browse", there should be something in German.
    Can I change that word somehow?

    Hi Daniel,
    A very good hack has been found out for the same. Look at this weblog...
    /people/dagfinn.parnas/blog/2004/08/15/inputfile-how-to-hide-the-plain-browse-button
    I am sure you can find a way out from this and please let us know, your approach as well
    Regards,
    Subramanian V.

  • FileUpload.bsp in BSP application SBSPEXT_HTMLB

    Hi,
    On the layout of this page FileUpload.bsp there is an element like this:
          <htmlb:fileUpload id       = "<%= %_testSuite->seq_nr( )%>"
                            onUpload = "HandleUpload" />
    Where can I find source code of "HandleUpload"?
    Thanks,

    Hi Pulau,
    I repeat - there is sample code in the online documentation.
    To quite directly from it...
    If you want to read the uploaded file on the server, you do this in the
    event handling phase in OnInputProcessing.
    Cheers
    Graham Robbo

Maybe you are looking for