How to upload a binary file with Firefox 7

Don't know if this is the right forum to ask this - if not, please point me in the right direction.
I am an embedded developer using Firefox as the user interface to an embedded web server. In the past I've been using file.getAsBinary() to read the local file which is then uploaded with an XMLHttpRequest. Firefox 7 removed the getAsBinary method. Looking through the documentation I came across FileReader and have been trying to use that but with no luck. When I use the readAsBinaryString method, the binary has many bytes which are in error. I have also tried the readAsDataURL but this gives me base64 encoding. Attempts to decode it so far have been unsuccessful. What's the best way to get a local file and upload it to a remote server?
Thanks,
Dave

Well, actually, i have no perfect solution.
I just used a temporary internal table in which all fields are characters. Then, I used FM GUI_UPLOAD to upload text file including header into this table as usual.
You can see that it was done successfully. Next, use a loop to transfer this temporary table to the main table. SAP will automatically convert data into values that are compatible with data type in the main table, so don't worry about different types :D.
In order to make this work more simple, field names of temporary table should be named exactly as same as those in the main one. So, u just use:
loop at itab_tmp.
  move-corresponding itab_tmp to itab_main.
  append itab_main.
  clear itab_main.
endloop.
note: both tables have their own header line, so don't need use a working area here.
Anyone has any better solution?

Similar Messages

  • How to get rid of a binary file with firefox that pop up allthe time?

    each time that i open moxilla firefox a box asking if I want to save or cancel the binary file. I have tried to ignore ti however it has become a bother. How do I stop the box from popping up ?

    Hi
    if you mean http://db.tidbits.com/ - I didn't get any popups in a few minutes of browsing there, this without any blocking software. If you're seeing the very same ad popup window from differing sites, then it'd sure be worth looking at whether or not your mac or router or isp is using some rogue dns server.
    DNS - Domain Name System
    it translates domain names meaningful to humans into the numerical (binary) identifiers associated with networking equipment for the purpose of locating and addressing these devices worldwide. An often-used analogy to explain the Domain Name System is that it serves as the "phone book" for the Internet by translating human-friendly computer hostnames into IP addresses. For example, www.example.com translates to 192.0.32.10.
    to borrow from wiki.
    DNS servers can be chosen in your router or in your mac at System Preferences-Network-Advanced-DNS tab, If no special dns servers are selected, your router will usually accept the isp's suggestion, so you'll be using theirs, for better or for worse.
    The most common place for any 'rogue' dns to be set, is in System Preferences-Network-Advanced-DNS tab... look there on your mac, and see if any numbers are visible. Copy them & paste here, then we'll know what's going on.

  • How can I upload and download files with uiXML?

    I want to implement upload and download files with uiXML. In some previouse topic I got answare to look in AbstractPageBroker class in JavaDOC. I did it but this is a very-very little resolution description for this problem. I think for developers YOU (UIX Team) must in very quick time to put some examples on the NET because this is a nice technology but with adecvate samplase and developers guide it will be dead very soon. I digging this forum for information. I see many many people have same problems about this technology. They like it and want to use and try but documentation is very very poor.
    WE WANT EXAMPLES and separate forum for UIX. I think it deserve this.
    If You have any more detailed documentation would be nice to put on the net. I have uixdemo.zip file but this is in very early fase of development. I downloaded it before fwe months. And now I can't find it anymore on youre site. What happend?

    Attila -
    I went back and re-read the JavaDoc for AbstractPageBroker and MultipartFormItem and put together the following sample PageBroker based on the description from the JavaDoc:
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletContext;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.share.util.MultipartFormItem;
    import oracle.cabo.servlet.xml.UIXPageBroker;
    * An extension of UIXPageBroker which stores all uploaded
    * files in the temporary directory.
    public class UploadingPageBroker extends UIXPageBroker
    * Override of AbstractPageBroker.doUploadFile() which saves
    * all files to the temporary directory.
    protected String doUploadFile(
    BajaContext context,
    Page page,
    MultipartFormItem item) throws IOException
    // Get the location of the file to create in the temp directory.
    // Of course a real application probably wouldn't upload files to
    // the temp directory - just using this contrived example to
    // demonstrate basic uploading support.
    File file = _getFile(context, item);
    if (file != null)
    // Create a FileOutputStream. Of course, a real application would
    // probably want to buffer the output
    FileOutputStream out = new FileOutputStream(file);
    // Write out the file
    item.writeFile(out);
    // Close up the output stream
    out.close();
    // We can return a value here to add to the PageEvent
    // if so desired.
    return null;
    // Gets the File for the item that we are uploading
    private File _getFile(
    BajaContext context,
    MultipartFormItem item
    // Get the file name
    String name = item.getFilename();
    // If we don't have a file, bail...
    if (name == null)
    return null;
    // Get the path to the temporary directory
    File dir = _getTempDir();
    // Return the File object
    return new File(dir, name);
    // Returns the path to the temprary directory
    private File _getTempDir()
    // Get the temporary directory from the ServletContext
    ServletConfig sConfig = getServlet().getServletConfig();
    ServletContext sContext = sConfig.getServletContext();
    return (File)sContext.getAttribute("javax.servlet.context.tempdir");
    In this sample, each uploaded file is simply saved in the temporary directory. You'll want to replace the code that creates the FileOutputStream for the uploaded file to use whatever OutputStream makes sense for your application.
    BTW - I used the following UIX page to test this out:
    <?xml version="1.0" encoding="UTF-8"?>
    <page xmlns="http://xmlns.oracle.com/uix/controller">
    <content>
    <pageLayout xmlns="http://xmlns.oracle.com/uix/ui">
    <contents>
    <form name="uploadForm" usesUpload="true">
    <contents>
    <fileUpload name="uploadedFile"/>
    <submitButton name="upload" text="Upload"/>
    </contents>
    </form>
    </contents>
    </pageLayout>
    </content>
    </page>
    Hope this sample helps with the uploading part of your question. I'll see if I can provide a download sample in a later post.

  • When I open .txt files with firefox all underscores disappear. How do I fix this?

    I have a list of websites in a .txt file and they all contain underscores. When I open the file with firefox all underscores turn into spaces, so that the links don't actually work.

    Can you post a short excerpt of this text file?
    Note that you usually need an extension to open links in a text file via a left-click with the mouse.
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • How to upload an excel file using ABAP.

    Hi,
    Can anyone please help me in understanding how to upload an excel file using ABAP.
    Thanks!!

    http://diocio.wordpress.com/2007/02/12/sap-upload-excel-document-into-internal-table/
    check the link
    TYPES: Begin of t_record,
    name1 like itab-value,
    name2 like itab-value,
    age   like itab-value,
    End of t_record.
    DATA: it_record type standard table of t_record initial size 0,
    wa_record type t_record.
    DATA: gd_currentrow type i.
    *Selection Screen Declaration
    PARAMETER p_infile like rlgrap-filename.
    *START OF SELECTION
    call function ‘ALSM_EXCEL_TO_INTERNAL_TABLE’
    exporting
    filename                = p_infile
    i_begin_col             = ‘1&#8242;
    i_begin_row             = ‘2&#8242;  “Do not require headings
    i_end_col               = ‘14&#8242;
    i_end_row               = ‘31&#8242;
    tables
    intern                  = itab
    exceptions
    inconsistent_parameters = 1
    upload_ole              = 2
    others                  = 3.
    if sy-subrc <> 0.
    message e010(zz) with text-001. “Problem uploading Excel Spreadsheet
    endif.
    Sort table by rows and colums
    sort itab by row col.
    Get first row retrieved
    read table itab index 1.
    Set first row retrieved to current row
    gd_currentrow = itab-row.
    loop at itab.
      Reset values for next row
    if itab-row ne gd_currentrow.
    append wa_record to it_record.
    clear wa_record.
    gd_currentrow = itab-row.
    endif.
    case itab-col.
    when ‘0001&#8242;.                              “First name
    wa_record-name1 = itab-value.
    when ‘0002&#8242;.                              “Surname
    wa_record-name2 = itab-value.
    when ‘0003&#8242;.                              “Age
    wa_record-age   = itab-value.
    endcase.
    endloop.
    append wa_record to it_record.
    *!! Excel data is now contained within the internal table IT_RECORD
    Display report data for illustration purposes
    loop at it_record into wa_record.
    write:/     sy-vline,
    (10) wa_record-name1, sy-vline,
    (10) wa_record-name2, sy-vline,
    (10) wa_record-age, sy-vline.
    endloop.

  • How to upload a PDF file in iCloud

    Hi everybody,
    I would like to know how to upload a PDF file in iCloud. I want to share some PDF files with my iPhone, MacBook and iMac.
    Thank you a lot!

    Yes, but the problem is will iBooks remember where I left off in that pdf file? Unlikely since it was deleted.  Also, what is handy about the kindle app is once you delete it an icon appears in the app to show that this file is in the cloud. I guess for reading pdfs the kindle app is better.  I am not saying that the kindle app would be that great for other things but at least with syncing and such it's much better.  Well, iCloud is meant for other things.  It's fine because I'll just use it for those other things and stick to the kindle app for reading pdfs.  Well I use endnote for reading technical pdfs, I'm just talking about novels and such on the kindle app. 

  • How to upload a XML file to Servlet

    Hi,
    I am new to Java, I have to upload an XML file to java/j2ee server. The web server running on the server is "Tomcat 4.1". My new requirement is I have to upload an "Input.XML" file, can you please tell me how to upload an XML file. If any samples appriciated very soon.
    Thanks & Regards,

    Hi!
    On the client side, the client's browser must support form-based upload. Most modern browsers do, but there's no guarantee. For example,
    <FORM ENCTYPE='multipart/form-data'
    method='POST' action='/myservlet'>
    <INPUT TYPE='file' NAME='mptest'>
    <INPUT TYPE='submit' VALUE='upload'>
    </FORM>
    The input type &quot;file&quot; brings up a button for a file select box on the browser together with a text field that takes the file name once selected. The servlet can use the GET method parameters to decide what to do with the upload while the POST body of the request contains the file data to parse.
    When the user clicks the "Upload" button, the client browser locates the local file and sends it using HTTP POST, encoded using the MIME-type multipart/form-data. When it reaches your servlet, your servlet must process the POST data in order to extract the encoded file. You can learn all about this format in RFC 1867.
    Unfortunately, there is no method in the Servlet API to do this. Fortunately, there are a number of libraries available that do. Some of these assume that you will be writing the file to disk; others return the data as an InputStream.
    You can see more things about Servlet on this website [http://pedrofao.blogspot.com|http://pedrofao.blogspot.com].

  • Upload new pdf file with the same name

    We are trying to upload a pdf file with a specific name (i.e
    file.pdf) that has links to it on many pages of a website. We need
    the pdf file to keep the same name but when we try to upload it,
    Contribute is being 'smart' and changing the name so as to not
    overwrite the file on the server. But we WANT to overwrite the file
    on the server. Any ideas on how we can achieve this in Contribute?
    Thanks so much (in advance) for your help!

    Actually, we have the same problem and I believe the answer
    lies in the abilities that your role has assigned to it. The
    solution that ThinkInk gave works *if you are allowed to delete
    files*. If your role doesn't have that permission, then it will
    just upload another copy of the file and rename it.
    It's rather irritating that there isn't more control over
    this...our server is littered with *thousands and thousands* of
    duplicate files that originate from this situation.
    If your administrator wants you to be able to delete files as
    well, then you could get him/her to give you that permission, and I
    believe this will allow you to overwrite the file by using the
    "Publish file from my computer" option described above.

  • Has anyone been able to upload an ibooks file with audio only files (m4a) in it? I keep getting the following error message during the upload in iTunes Producer: ERROR ITMS-9000: "Files of type audio/x-m4a are not allowed outside of widgets.

    Has anyone been able to upload an ibooks file with audio only files (m4a) in it? I keep getting the following error message during the upload in iTunes Producer: ERROR ITMS-9000: "Files of type audio/x-m4a are not allowed outside of widgets. then it names the file as an m4p file. Everything works beautifully on the iPad through Preview, and validates through iTunes Producer up until the attempted upload. If you've been able to accomplish this, please let me know how you prepared your audio files. Many thanks.

    Hello Fellow iBook Authors!
    Today I received the same error that you all have been discussing.  I tried selecting the DRM
    and this did not work for me, though I'm glad it did for some.  Here's what I did as a work-around. . .
    Since iBooks Author did not have a problem with Videos, I simply used one of my video programs, ScreenFlow to turn the audio into a video file m4v.  I added an image and extended the length or timing of the image to span the length of the audio file.  Then exported as an .mov.  I then opened QuickTime and opened the file and exported the file to iTunes. 
    You can use iMovie, Camtasia or any other progam that will allow you to export the audio as a movie file.  Does this make sense?  I hope this helps, at least in the short-term.
    Michael Williams

  • How to update a dbf file with gui_upload???

    hi friends,
    i would like to know how to update a dbf file with gui_upload???
    as i hve already know that it's easy to convert dbf to tab formatted text fle and thn upload it.but i want the direct uploading way.i don't let my user's bsy with converting existing dbf to txt.so pls help me asap!!!!!i will be thankful to you!!!!!

    its very easy you can search other forum!!!

  • CRM ABAP How to upload an Excel file into an internal table?

    How to upload an Excel file using GUI_UPLOAD?? what should be the values of the parameters? The function modules ALSM_EXCEL_TO_INTERNAL_TABLE and KCD_EXCEL_OLE_TO_INT are not present in CRM. Please suggest me a way out!

    Hi saurabh,
    you can try the folowing sample..
    and make modifications according to your requirement..
    TYPE-POOLS: truxs.
    DATA: i_text_data TYPE truxs_t_text_data,
    v_filename_string TYPE string.
    DATA: BEGIN OF itab OCCURS 0,
    Name(30),
    Phone(15),
    Fax(500).
    DATA: END OF itab.
    PARAMETERS: p_file LIKE rlgrap-filename.
    START-OF-SELECTION.
    v_filename_string = p_file.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = v_filename_string
    filetype = 'ASC'
    has_field_separator = 'X'
    * HEADER_LENGTH = 0
    * READ_BY_LINE = 'X'
    dat_mode = ''
    * IMPORTING
    * FILELENGTH =
    * HEADER =
    TABLES
    data_tab = i_text_data
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
    i_field_seperator = 'X'
    * I_LINE_HEADER =
    i_tab_raw_data = i_text_data
    i_filename = p_file
    TABLES
    i_tab_converted_data = itab
    EXCEPTIONS
    conversion_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.
    this is a sample code that uploads a excel file using GUI_UPLOAD, but uses another function module to convert that uploaded data into an internal table..
    regards
    satesh

  • How to upload normal excell file to ztable

    Hi All there,
    Can anybody tell me how to upload normal excell file to ztable directly.
    pl provide detail coding
    Regards
    Sagar

    Hi Sagar,
       first upload the excel data into your internal table using a FM than upload the data to your ZTABLE using BDC.
    parameters:
      p_file type rlgrap-filename          " File name
      data:
        lw_file  type string.              " File Path
    data:
      t_bdcdata type
       standard table
             of bdcdata,
      fs_bdcdata type bdcdata.             " Work area for bdcdata
    * Messages of call transaction
    data:
      t_messtab type
       standard table
             of bdcmsgcoll,
      fs_messtab type bdcmsgcoll.          " Work area for messtab
    at selection-screen on value-request for p_file.
      call function 'F4_FILENAME'
       exporting
         program_name        = syst-cprog
         dynpro_number       = syst-dynnr
         field_name          = ' '
       importing
         file_name           = p_file.
      lw_file = p_file.
      call function 'GUI_UPLOAD'
        exporting
          filename                    = lw_file
          filetype                    = 'ASC'
          has_field_separator         = 'X'
          dat_mode                    = 'X'
        tables
          data_tab                    = t_final_data
        exceptions
          file_open_error              = 1
          file_read_error              = 2
          no_batch                     = 3
          gui_refuse_filetransfer      = 4
          invalid_type                 = 5
          no_authority                 = 6
          unknown_error                = 7
          bad_data_format              = 8
          header_not_allowed           = 9
          separator_not_allowed        = 10
          header_too_long              = 11
          unknown_dp_error             = 12
          access_denied                = 13
          dp_out_of_memory             = 14
          disk_full                    = 15
          dp_timeout                   = 16
          others                       = 17.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.                               " IF SY-SUBRC <> 0
      if t_final_data is initial.
        message 'File not found'(003) type 'E'.
      endif.                               " IF T_FINAL_DATA IS INITIAL
    end-of-selection.
      perform upload_0585_data_using_bdc.  " populate the bdcdata table using tcode SHDB
      call transaction 'PA30' using t_bdcdata
                               mode 'A'
                           messages into t_messtab.
    form upload_0585_data_using_bdc.
      loop at t_final_data into fs_final_data.
    perform bdc_field       using 'Q0585-ACNTR(07)'
                                   w_curr.
    perform bdc_field       using 'Q0585-ACOPC'
                                   lw_flag.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=UPD'.
    perform bdc_dynpro      using 'MP058500' '2000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/EBCK'.
    perform bdc_dynpro      using 'SAPMP50A' '1000'.
    endloop.
    *        Start new screen                                              *
    form bdc_dynpro using program dynpro.
      clear fs_bdcdata.
      fs_bdcdata-program  = program.
      fs_bdcdata-dynpro   = dynpro.
      fs_bdcdata-dynbegin = 'X'.
      append fs_bdcdata to t_bdcdata.
    endform.                               " Form bdc_dynpro using program...
    *        Insert field                                                  *
    form bdc_field using fnam fval.
        clear fs_bdcdata.
        fs_bdcdata-fnam = fnam.
        fs_bdcdata-fval = fval.
        append fs_bdcdata to t_bdcdata.
    endform.                               " Form bdc_field using fnam fval
    With luck,
    Pritam.

  • How to upload non iWork files to iCloud...am I missing something?

    I am wondering how to upload non iWork files to iCloud..such as pdf's, Xls, etc....etc any type of file really the way I could with iDisk.
    Am I missing something simple?
    Thnaks,
    Derek

    Thanks for your reply. Just curious if this method is standard setup the way Apple recommends to use iCloud in this situation or if it is a work around to accomplish what I am after?
    Thanks again!
    d.

  • How to Upload License Key File of MiniSap to SAP System ?

    Hi,
    I have received the license key for MiniSap. I have downloaded the license key file to my local system. Please tell me how to upload this file to the SAP system. I am using Windows XP (SP2) and the MiniSap edition is 6.10 WA1.
    I have to tried to directly enter the license key through transaction code Slicense but got the error "Incorrect Parameter Specified". I also tried to install through OS level but even could not do so. I have ordered key 5 times, none works on either SAP level or the OS level.
    Somebody told me to upload the file, Please Guide me how to upload license key file to the SAP System.
    Thank You
    Best Regards,
    Ryan

    Very late into the reply. But I am sure someone will run into this issue again -
    In windows cmd prompt, navigate to c:\mbs.
    Then type saplicense.exe -install then follow the prompt.
    NOTE: If you get the following error -
    C:\MBS>saplicense.exe -install
    *** SAPLICENSE (Release 46D) ERROR ***
        ERROR:   Can not set DbSl trace function
        DETAILS: DbSlControl(DBSL_CMD_IMP_FUNS_SET) failed with return code 20
        RC-INFO: error loading dynamic db-library - check environment for:
                 dbms_type = <db-type>  (e.g. ora)
                 DIR_LIBRARY = <path to db-dll>  (e.g. /usr/sap/SID/SYS/exe/run)
    Type"C:\MBS>dbenv.cmd", once it is done. simply retype
    saplicense.exe -install then follow the prompt.
    Good Luck.
    T.H.

  • How can i download old settings with firefox sync ? i formatted my computer thinking that the data will be restore on login , but it's only letting my sync firefox with mobile device , can someonr please help my ?

    how can i download old settings with firefox sync ? i formatted my computer thinking that the data will be restore on login , but it's only letting my sync firefox with mobile device , can someonr please help my ?

    '''Did you backup whatever bookmarks you did have on the computer ? '''
    Remember any restoring of bookmarks overwrites whatever he current set is, and you may not want to loose them.
    Even if up until now you have not made any backups of Desktop bookmarks Firefox will have backed up some of them into sets of daily bookmark backups. Once you have backed up your current set you could look at what it has by restoring those bookmarks, you may find one of those sets is fairly complete.
    By the way if you look at the profile files and folders that you should now have on the desktop you should see it contains a bookmarks backup folder, the size of the files within should indicate whether they contain anything.
    You need to go into the bookmarks library and try the restore option. Backup each set that you look at if it has anything of use in it, before trying the next set. With look one of those will be a fairly complete set of bookmarks.
    * USE '''Show All Bookmarks -> Import and Backup -> Restore '''
    ** see [[Restore bookmarks from backup or move them to another computer#w_restoring-from-backups]]_restoring-from-backups
    I do not use Firefox on mobiles, but before you try anything further you do need to backup the desktop bookmarks and learn what existing backups you have. Unless you master that you are in continual danger of overwriting and loosing bookmarks.
    Presumably you have already found this listing of help articles for mobiles
    * [/products/mobile/bookmarks]

Maybe you are looking for

  • Please tell me how to automatically play a sound file in a PDF slideshow?Da

    I use PS CS3, LR2, and now I purchased Acrobat 9.1 Pro.  My intent is to create an image based full screen automatic slideshow WITH SOUND.  I have everything working well but I can't figure out how to get the sound file to simply play along with the

  • Link to specific section of different page.

    I have a drop down menu on my nav bar.  I want the different links on the drop down menu to bring me to different sections of a different page. This is the code I have used. This is the html for the nav bar: <nav id="nav">   <ul>         <li class="c

  • A thought on Style for the sake of Style, and a question: Where to wire constants?

    Lately, I've been trying to hone in on aspects of Style that effect my program's performance, and ignoring stylistic niceties in the sake of meeting deadlines. For example, Local Variables: if they work and don't cause race conditions, what the hey?

  • Unable to Retrieve BW variants

    How to Retrieve BW Variants..my error discreption is like this..  Since today morning 9 am IST none of the BW variants are working by this i mean when we run the variant the data stored in the variant is not getting reflected in the selection screen.

  • Fatal Error when trying to download from new camera

    I have Elements 5.0 with Windows Vista HE.  I've added a new camera (Nikon Coolpix S630).  When I try to download from this camera via USB - first my Adobe Photo Downloader does not open as it does with my other 2 digital cameras when connecting, sec