Skip to Content
avatar image
Former Member

File browser

Hi,

I work on a BSP application. This application is multi-language. For this, i use OTR. My problem is that i want to upload file and i need a file browser to search the file to upload. I don't want to use the htmlb object "fileupload" because i want to master the destination of the upload. Then i have to use html object "INPUT type=file" but the button generated is translate in the browser language (Browse .. in english). But i want to control this and write in using OTR. Is there any object that can help me ? Or someone have a solution whith "INPUT type=file" ?

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Jul 30, 2004 at 04:47 PM

    I don't think that is possible. If you drill down to the fileupload definition, it also use html object input type=file.

    Other alternative, you may install the IE which customized to the language you want to use.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 30, 2004 at 09:00 PM

    The only way to move a file from the browser into the backend is via <input type=file>. Here you can either use raw HTML or the HTMLB fileUpload. Eitherway, it is going to require the type=file. Nothing to do.

    <i>I don't want to use the htmlb object "fileupload" because i want to master the destination of the upload.</i>

    I do not really understand this remark. The HTMLB fileUpload is just a wrapper around <input type=file>. Thereafter, you just use the get_data call to get the xstring of the uploaded file. The benefit of our tag is that it knows how to exstract the correct ⚠️ multipart sequence out of the incoming post.

    But then, good programmers like to roll their own. So, go for it.

    Have you looked at the <htmlb:fileUpload upload_text/> attribute?

    As for the browse text, why not use your favourite search engine, and let the eyes surf a little. The typical remarks I found are:

    <i>As far File is concerned, there is nothing you can do to change either the style or the label "Browse" or even clear its value...</i>

    Maybe you find the answer. We are also very interested!

    ++bcm

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 04, 2004 at 02:05 PM

    That is sweet! I hope you don't mind. I took you code and make it to use htmlb elements so it has the same look and feel 😉

    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page title="text extension " >
        <script>
          function processFile()
          {
            document.forms["myForm"].browse.click();
            document.forms["myForm"].file.value = document.forms["myForm"].browse.value;
          }
        </script>
        <htmlb:form id="myForm" >
          <input type=file name=browse style="display:none;">
          <htmlb:inputField id    = "file"
                            size  = "50" />
          <htmlb:button text          = "Select a file..."
                        onClientClick = "processFile()" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 09, 2004 at 12:07 PM

    Hi Peter,

    Let me put my two cents:

    The upload returns a data type XSTRING, which show you a 2 digit hex code, you need to convert this to string.

    Please read Brian's web log on how two convert

    STRING <-> XSTRING<a href="/people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents Programming: Handling Of Non-HTML Documents</a>

    I think this topic is not related at all with the original topic of this threat, and it would be better if you create separate topic.

    But that's just my two cents.

    Iwan

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks Iwan and Brain!

      I will check the mentioned weblogs.

      If I could convert XSTRING to STING, then the original problem can be solved (upload file to the server).

      Anyway, I will test it, and let you know the result (may be in a separate topic).

      Peter

  • avatar image
    Former Member
    Aug 10, 2004 at 12:22 PM

    Just to completely beat the horse dead...

    File" target="_blank">http://www.cs.tut.fi/~jkorpela/forms/file.html">File Input Field

    Particulary interesting in this site is the linkhttp://groups.google.com/groups?oi=djq&as_umsgid=%3C38119FEE.DFF60EBA%40sector27.de%3E">link> that points to this message

    With <a href="http://developer.netscape.com/docs/manuals/communicator/jsguide/scripts.htm">signed script</a> in NN
     
    netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite');
      document.formName.inputName.value = 'whatever'
    

    And with that it begs the question, where is the hole in IE that allows that as well?

    Some have chosen the ActiveX approach which causes not only problems but also concerns.

    Others have chosen something like this:

    <form>
     <input type="file" name="myfile" style="display:none" onchange="fileName=this.value"> 
     <input type="button" value="open file" onclick="myfile.click()"></p>
     <input type="button" value="show value" onclick="alert(fileName)"> </p>
    </form>
    

    As you can see the button activates the file upload since the file upload is actually hidden on the page.

    With that (considering most is just re-stating previous messages) I would say that perhaps one of the moderators might lock this message?

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 16, 2004 at 05:05 AM

    <b>Input=FILE, how to hide the plain browse button</b>

    /people/dagfinn.parnas/blog/2004/08/15/inputfile-how-to-hide-the-plain-browse-button

    Dagfinn Parnas

    This is a response to the challenge from Brian McKellar, on how to use <input type=file>, but replacing the browse button. It shows you how to style the browse button anyway you would like, you can even replace it with an image.

    Add comment
    10|10000 characters needed characters exceeded