Writing Files to WAR for downloads

I've got a web application that uses some Java classes to write out files to a directory under the web application root. With an exploded WAR file the files can be written to the directory and then users can grab them via a url.
          Is it possible to use this mechanism with a jar'd WAR file? Would this be an app server dependency? I assumed that the war file would be exploded somewhere and that the servletcontext object would have the true path to where on the computer the exploded war was, but this is not the case.
          Bottom line - has anyone figured out how to write files to WAR file at runtime so that clients cna then download files via url?
          Any ideas would be great.

Sounds like you've found at least one of the culprits.
However, I was going to ask:  Is it NTFS formatted?  I believe NTFS on disk is slightly different (updated) with Windows 8 than with earlier versions, and there's special code to convert back and forth to help maximize compatibility. 
Look specifically, for example, for information on LFS version.
You can get specific information about your NTFS version using this command
fsutil fsinfo ntfsinfo <volume>
-Noel
Detailed how-to in my eBooks:  
Configure The Windows 7 "To Work" Options
Configure The Windows 8 "To Work" Options

Similar Messages

  • Sessionstore.js file pop-ups for download, then disappears

    My prob is related to this one https://support.mozilla.org/en-US/questions/967691 but it is a bit different. I didn't notice if MF uploads without any reason (I don't observe this till now) but a .js file popped up for download all of a sudden until I dll-ed other things from Sendspace. The dll dialog box with it disappeared before I could react. Later it wasn't listed in Downloads. I found it as I checked all MF folders for *.js and I saw only one was with the same date and hour as the file popped up and it was sessionstore.js. I have "Flash and Video Download 1.38" add-on which is listed as a possible prob in the thread I linked. I deleted this file and the .bak one as it is said in the other thread. Should I disable the add-on too?

    The sessionstore.js file in your currently active profile folder is updated every time you navigate to a new window or tab, as often as every 15 seconds. It seems very unlikely that a website would want to download/replace this file -- the site couldn't accurately update it because it doesn't know your browser history. Unless it was some kind of strange attack that causes you to load windows and tabs of the site's choosing when you restart Firefox and restore your previous session. ??
    In some cases, you may see a prompt to open/save a js or json file when there is a glitch with the background communications conducted by scripts in the page. Sometimes Google search users report this (e.g., [https://support.mozilla.org/en-US/questions/921535 Occasionally, when I try to do a Google search, numerous "opening search" pop-up windows appear.]). Unless you spot a pattern, it could be difficult to find the cause.

  • Link a pdf file from flash for download?

    I want to know how to link a pdf file from flash and make it availble for download?

    that was fast
    i know how to link to another page, using get url. would it do the same way with a pdf?
    And also how do i get flash to force a download box, that will appear in front of the flash movie and prompt the user to download the file.
    Thanks
    Jared Williams
    Art Director
    Mindpro Multimedia Studio
    (246) 425-3598
    (246) 263-1931
    [email protected]
    www.mindprostudio.com

  • Writing files in air for android

    I'm trying to create a user license agreement that will show the first time a player opens my game. I'm using a FileStream with a complete event and an IOEvent. The IOEvent is triggered the first time because the file I'm looking for doesn't exist. I then show the user agreement and write the file to the application storage directory. If I then close the game and open it a second time I expect the Complete event to fire since the file now exists but instead the IOEvent is firing again. Why isn't it finding the file and triggering the complete event? I can read the file after I create it so I know it exists at that point.
    import flash.filesystem.File;
    import flash.filesystem.FileStream;
    import flash.filesystem.FileMode;
    import flash.events.Event;
    import flash.events.IOErrorEvent;
    import flash.utils.ByteArray;
    //load ula file
    var file:File = File.applicationStorageDirectory;
    file.resolvePath("version.txt");
    var version:String = "1.0";
    var stream:FileStream = new FileStream();
    stream.addEventListener(Event.COMPLETE, checkVersion);
    stream.addEventListener(IOErrorEvent.IO_ERROR, noVersion);
    stream.openAsync(file,FileMode.UPDATE);
    function checkVersion(e:Event):void{
            testText.text += "found file";
            stream.removeEventListener(Event.COMPLETE, checkVersion);
            stream.removeEventListener(IOErrorEvent.IO_ERROR, noVersion);
            var ver:String = e.target.readUTFBytes(e.target.bytesAvailable);
            if(ver == version.toString()){
                    stream.close();
                    file = null;
                    stream = null;
                    testText.text += "goto splash screen";
                    //gotoAndStop("SplashScreen");
            else{
                    stream.writeUTFBytes(String(version));
                    stream.close();
                    file = null;
                    stream = null;
                    testText.text += "wrong version number";
                    //ula.testText.text = "writing file version = "+version;
                    //ula.visible = true;
    function noVersion(e:IOErrorEvent):void{
            stream.removeEventListener(Event.COMPLETE, checkVersion);
            stream.removeEventListener(IOErrorEvent.IO_ERROR, noVersion);
            testText.text += "file doesn't exist error = "+e.text;
            stream.close();
            file = null;
            stream = null;
            var file2:File = File.applicationStorageDirectory.resolvePath("version.txt");
            var stream2:FileStream = new FileStream();
            stream2.open(file2, FileMode.WRITE);
            stream2.writeUTFBytes(version);
            stream2.close();
            file2 = null;
            stream2 = null;
            testText.text += "   created file";
     }

    I use this
    var f:File= new File(File.documentsDirectory.resolvePath("RunBit.csv").url);
        if (!f.exists) {
            //Create file
    CHECK THE PERMISSIONS

  • Hi, can someone tell me what exactly is QuickTimeMPEG2.dmg? its an installer file i need for downloading the QuickTime Mpeg-2 Playback Component. Where exactly can I find this as well?

    hi, can someone tell me what exactly is QuickTimeMpeg2.dmg? Its some kind of installer file for downloading QuickTime Mpeg-2 Playbaack Component but I don't know where exactly to find it or how to get it on my mac?

    Hello,
    http://forums.macrumors.com/showthread.php?t=1332324
    If you want it on your Mac, not sure it works or not in your OS version.
    Then double click on the DMG, that'll mount the disk image, in that you'l likely see an installer .pkg to double click on to install.

  • Incorrect file icon/preview for downloaded files

    Hey all,
    I've recently upgraded to Mavericks and I've noticed an issue where files I've downloaded from the internet will sometimes appear as they should on my desktop with the appropriate icon based on the file extension or with the appropriate icon preview, but in other instances the file icon looks like the one in the attached screen shot. The file still opens fine and behaves normally, but the icon is weird and makes it hard to quickly find when I'm looking or a specific photo or type of file. Any solutions?
    Thanks,

    It works as it should.
    Mylenium

  • Help for download local file

    Hi!!!
    This is my first post. Thanks to all the people here before all.
    I have a big problem trying to download a local file to an internal table. I have lines with more than 8000 positions, and i've tried to use WS_UPLOAD, GUI_UPLOAD and SO_OBJECT_UPLOAD, but all of them show me this messages:
       - Unable to satisfy send request: 8001 bytes.
    ¿Do you know any function module (i think it could be OO) that allows me to load this file?
    Thanks for all. Bye!

    Hi
    REPORT ZDOWN_UP_LOAD
            NO STANDARD PAGE HEADING
            LINE-SIZE  255.
    Declare Database Objects
    tables:
       DOKIL,
       TRDIR.
    Constants
    CONSTANTS:
       MC_TRDIR_IDENTIFIER(72)  TYPE C VALUE '%&%& RDIR',
       MC_REPORT_IDENTIFIER(72) TYPE C VALUE '%&%& REPO',
       MC_TEXT_IDENTIFIER(72)   TYPE C VALUE '%&%& TEXP',
       MC_THEAD_IDENTIFIER(72)  TYPE C VALUE '%&%& HEAD',
       MC_DOC_IDENTIFIER(72)    TYPE C VALUE '%&%& DOKL',
       MC_TRDIR_SHORT(4)        TYPE C VALUE 'RDIR',
       MC_REPORT_SHORT(4)       TYPE C VALUE 'REPO',
       MC_TEXT_SHORT(4)         TYPE C VALUE 'TEXP',
       MC_THEAD_SHORT(4)        TYPE C VALUE 'HEAD',
       MC_DOC_SHORT(4)          TYPE C VALUE 'DOKP'.
    Declare Module level data structures
    DATA: BEGIN OF MTAB_PROGRAM_SOURCE OCCURS 0,
             LINE(72) TYPE C,
           END OF MTAB_PROGRAM_SOURCE.
    DATA: MTAB_PROGRAM_TRDIR LIKE TRDIR OCCURS 0 WITH HEADER LINE.
    DATA: MTAB_PROGRAM_TEXTS LIKE TEXTPOOL OCCURS 0 WITH HEADER LINE.
    DATA: MSTR_THEAD LIKE THEAD.
    DATA: BEGIN OF MTAB_PROGRAM_FILE OCCURS 0,
             LINE(275) TYPE C,
           END OF MTAB_PROGRAM_FILE.
    DATA: BEGIN OF MTAB_DIRECTORY OCCURS 0,
             NAME LIKE TRDIR-NAME,
             DESC(72) TYPE C,
             SAVENAME LIKE RLGRAP-FILENAME,
           END OF MTAB_DIRECTORY.
    DATA: BEGIN OF MTAB_PROGRAM_DOCUMENTATION OCCURS 0,
             LINE(255) TYPE C,
           END OF MTAB_PROGRAM_DOCUMENTATION.
    Selection Screen
    *-- Options for upload/download of programs
    SELECTION-SCREEN BEGIN OF BLOCK FRM_OPTIONS WITH FRAME TITLE TEXT-UDL.
    PARAMETERS:
       RB_DOWN RADIOBUTTON GROUP UDL DEFAULT 'X'.       " Download reports
    SELECTION-SCREEN BEGIN OF BLOCK FRM_TRDIR WITH FRAME TITLE TEXT-DIR.
    SELECT-OPTIONS:
       S_NAME  FOR TRDIR-NAME,              " Program Name
       S_SUBC  FOR TRDIR-SUBC               " Program Type
               DEFAULT 'F' OPTION EQ SIGN E," Exclude Functions by default
       S_CNAM  FOR TRDIR-CNAM               " Created by
               DEFAULT SY-UNAME,
       S_UNAM  FOR TRDIR-UNAM,              " Last Changed by
       S_CDAT  FOR TRDIR-CDAT,              " Creation date
       S_UDAT  FOR TRDIR-UDAT.              " Last update date
    SELECTION-SCREEN END OF BLOCK FRM_TRDIR.
    *-- Options for uploading programs
    PARAMETERS:
       RB_UP   RADIOBUTTON GROUP UDL.       " Upload reports
    SELECTION-SCREEN BEGIN OF BLOCK FRM_UPLOAD WITH FRAME TITLE TEXT-UPL.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(29) TEXT-SNG.
    PARAMETERS:
       RB_FILE RADIOBUTTON GROUP HOW DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 33(42) TEXT-FNA.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS:
       RB_LIST RADIOBUTTON GROUP HOW.
    SELECTION-SCREEN END OF BLOCK FRM_UPLOAD.
    SELECTION-SCREEN END OF BLOCK FRM_OPTIONS.
    *-- Options for up/downloading programs
    SELECTION-SCREEN BEGIN OF BLOCK FRM_FILEN WITH FRAME TITLE TEXT-FIL.
    PARAMETERS:
       RB_DOS  RADIOBUTTON GROUP FIL DEFAULT 'X', " Save to local
       RB_UNIX RADIOBUTTON GROUP FIL,       " Save to UNIX
       P_PATH  LIKE RLGRAP-FILENAME         " Path to save files to
             DEFAULT 'c:\abap\'.
    SELECTION-SCREEN END OF BLOCK FRM_FILEN.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_NAME-LOW.
       CALL FUNCTION 'F4_PROGRAM'
            EXPORTING
                 OBJECT             = S_NAME-LOW
                 SUPPRESS_SELECTION = 'X'
            IMPORTING
                 RESULT             = S_NAME-LOW
            EXCEPTIONS
                 OTHERS             = 1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_NAME-HIGH.
       CALL FUNCTION 'F4_PROGRAM'
            EXPORTING
                 OBJECT             = S_NAME-HIGH
                 SUPPRESS_SELECTION = 'X'
            IMPORTING
                 RESULT             = S_NAME-HIGH
            EXCEPTIONS
                 OTHERS             = 1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_UNAM-LOW.
       PERFORM GET_NAME USING 'S_UNAM-LOW'
                     CHANGING S_UNAM-LOW.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_UNAM-HIGH.
       PERFORM GET_NAME USING 'S_UNAM-HIGH'
                     CHANGING S_UNAM-HIGH.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_CNAM-LOW.
       PERFORM GET_NAME USING 'S_CNAM-LOW'
                     CHANGING S_CNAM-LOW.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_CNAM-HIGH.
       PERFORM GET_NAME USING 'S_CNAM-HIGH'
                     CHANGING S_CNAM-HIGH.
    TOP-OF-PAGE.
       IF RB_LIST = 'X'.
         FORMAT COLOR COL_HEADING.
         NEW-LINE.
         WRITE: AT 3 TEXT-H01,
                AT 15 TEXT-H03.
         FORMAT COLOR OFF.
       ENDIF.
    AT LINE-SELECTION.
       CHECK RB_LIST = 'X'.                 " only do in list mode
       READ LINE SY-CUROW FIELD VALUE MTAB_DIRECTORY-SAVENAME.
    *-- Read file into an internal table
       PERFORM READ_REPORT_FROM_DISK TABLES MTAB_PROGRAM_FILE
                                     USING  MTAB_DIRECTORY-SAVENAME.
    *-- Split table into TADIR entry, report lines, and report text
       PERFORM SPLIT_INCOMING_FILE TABLES MTAB_PROGRAM_FILE
                                          MTAB_PROGRAM_SOURCE
                                          MTAB_PROGRAM_TEXTS
                                          MTAB_PROGRAM_DOCUMENTATION
                                 CHANGING TRDIR
                                          MSTR_THEAD.
    *-- Save all of the data
       PERFORM INSERT_NEW_REPORT TABLES MTAB_PROGRAM_SOURCE
                                        MTAB_PROGRAM_TEXTS
                                        MTAB_PROGRAM_DOCUMENTATION
                                 USING  TRDIR
                                        MSTR_THEAD.
    Start of processing
    START-OF-SELECTION.
       FORMAT COLOR COL_NORMAL.
       IF RB_DOWN = 'X'.
         PERFORM DOWNLOAD_REPORTS.
       ELSEIF RB_UP = 'X'.
         PERFORM UPLOAD_REPORTS.
       ENDIF.
    END-OF-SELECTION.
       IF RB_DOWN = 'X'.
         CONCATENATE P_PATH
                     'directory.txt'
           INTO P_PATH.
         PERFORM SAVE_TABLE_TO_FILE TABLES MTAB_DIRECTORY
                                    USING  P_PATH.
       ENDIF.
          FORM UPLOAD_REPORTS                                           *
    FORM UPLOAD_REPORTS.
    *-- Can upload a reports entered in selection criteria or
    *-- select from a list.  List can be from index.txt in same directory
    *-- (created by the download) or by reading the first line of each file
    *-- in the directory.
       IF RB_FILE = 'X'. " Upload single program from a file
    *-- Read file into an internal table
         PERFORM READ_REPORT_FROM_DISK TABLES MTAB_PROGRAM_FILE
                                       USING  P_PATH.
    *-- Split table into TADIR entry, report lines, and report text
         PERFORM SPLIT_INCOMING_FILE TABLES MTAB_PROGRAM_FILE
                                            MTAB_PROGRAM_SOURCE
                                            MTAB_PROGRAM_TEXTS
                                            MTAB_PROGRAM_DOCUMENTATION
                                   CHANGING TRDIR
                                            MSTR_THEAD.
    *-- Save all of the data
         PERFORM INSERT_NEW_REPORT TABLES MTAB_PROGRAM_SOURCE
                                          MTAB_PROGRAM_TEXTS
                                          MTAB_PROGRAM_DOCUMENTATION
                                   USING  TRDIR
                                          MSTR_THEAD.
       ELSEIF RB_LIST = 'X'. " Show list for user to choose from
    *-- get list of report names/descriptions from directory text
         CONCATENATE P_PATH
                     'directory.txt'
         INTO P_PATH.
         PERFORM READ_REPORT_FROM_DISK TABLES MTAB_DIRECTORY
                                       USING  P_PATH.
         SORT MTAB_DIRECTORY.
    *-- Write out list of report names/descriptions
         LOOP AT MTAB_DIRECTORY.
           WRITE:
             / MTAB_DIRECTORY-NAME UNDER TEXT-H01,
               MTAB_DIRECTORY-DESC UNDER TEXT-H03,
               MTAB_DIRECTORY-SAVENAME.
         ENDLOOP.
    *-- Process user selections for reports to upload.
       ENDIF.
    ENDFORM.                               " upload_reports
          FORM DOWNLOAD_REPORTS                                         *
          From the user selections, get all programs that meet the      *
          criteria, and save them in ftab_program_directory.            *
          Also save the report to disk.                                 *
    FORM DOWNLOAD_REPORTS.
       DATA:
         LC_FULL_FILENAME LIKE RLGRAP-FILENAME.
    *-- The table is put into an internal table because the program will
    *-- abend if multiple transfers to a dataset occur within a SELECT/
    *-- ENDSELCT (tested on 3.1H)
       SELECT * FROM  TRDIR
              INTO TABLE MTAB_PROGRAM_TRDIR
              WHERE  NAME  IN S_NAME
              AND    SUBC  IN S_SUBC
              AND    CNAM  IN S_CNAM
              AND    UNAM  IN S_UNAM
              AND    CDAT  IN S_CDAT
              AND    UDAT  IN S_UDAT.
       LOOP AT MTAB_PROGRAM_TRDIR.
    *-- Clear out text and source code tables
         CLEAR:
           MTAB_PROGRAM_FILE,
           MTAB_PROGRAM_SOURCE,
           MTAB_PROGRAM_TEXTS,
           MTAB_PROGRAM_DOCUMENTATION.
         REFRESH:
           MTAB_PROGRAM_FILE,
           MTAB_PROGRAM_SOURCE,
           MTAB_PROGRAM_TEXTS,
           MTAB_PROGRAM_DOCUMENTATION.
    *-- Get the report
         READ REPORT MTAB_PROGRAM_TRDIR-NAME INTO MTAB_PROGRAM_SOURCE.
    *-- Get the text for the report
         READ TEXTPOOL MTAB_PROGRAM_TRDIR-NAME INTO MTAB_PROGRAM_TEXTS.
    *-- Get the documentation for the report
         CLEAR DOKIL.
         SELECT * UP TO 1 ROWS FROM DOKIL
                WHERE  ID          = 'RE'
                AND    OBJECT      = MTAB_PROGRAM_TRDIR-NAME
                AND    LANGU       = SY-LANGU
                AND    TYP         = 'E'
                ORDER BY VERSION DESCENDING.
         ENDSELECT.
    *-- Documentation exists for this object
         IF SY-SUBRC = 0.
           CALL FUNCTION 'DOCU_READ'
                EXPORTING
                     ID      = DOKIL-ID
                     LANGU   = DOKIL-LANGU
                     OBJECT  = DOKIL-OBJECT
                     TYP     = DOKIL-TYP
                     VERSION = DOKIL-VERSION
                IMPORTING
                     HEAD    = MSTR_THEAD
                TABLES
                     LINE    = MTAB_PROGRAM_DOCUMENTATION
                EXCEPTIONS
                     OTHERS  = 1.
         ENDIF.
    *-- Put the report code and texts into a single file
    *-- Put the identifier line in so that the start of the TRDIR line
    *-- is marked
         CONCATENATE MC_TRDIR_IDENTIFIER
         MTAB_PROGRAM_TRDIR-NAME
         INTO MTAB_PROGRAM_FILE-LINE.
         APPEND MTAB_PROGRAM_FILE.
    *-- Add the TRDIR line
         MTAB_PROGRAM_FILE-LINE = MTAB_PROGRAM_TRDIR.
         APPEND MTAB_PROGRAM_FILE.
    *-- Put the identifier line in so that the start of the report code
    *-- is marked
         CONCATENATE MC_REPORT_IDENTIFIER
                     MTAB_PROGRAM_TRDIR-NAME
           INTO MTAB_PROGRAM_FILE-LINE.
         APPEND MTAB_PROGRAM_FILE.
    *-- Add the report code
         LOOP AT MTAB_PROGRAM_SOURCE.
           MTAB_PROGRAM_FILE = MTAB_PROGRAM_SOURCE.
           APPEND MTAB_PROGRAM_FILE.
         ENDLOOP.
    *-- Put the identifier line in so that the start of the report text
    *-- is marked
         CONCATENATE MC_TEXT_IDENTIFIER
                     MTAB_PROGRAM_TRDIR-NAME
           INTO MTAB_PROGRAM_FILE-LINE.
         APPEND MTAB_PROGRAM_FILE.
    *-- Add the report texts
         LOOP AT MTAB_PROGRAM_TEXTS.
           MTAB_PROGRAM_FILE = MTAB_PROGRAM_TEXTS.
           APPEND MTAB_PROGRAM_FILE.
         ENDLOOP.
    *-- Put the identifier line in so that the start of the THEAD record
    *-- is marked
         CONCATENATE MC_THEAD_IDENTIFIER
                     MTAB_PROGRAM_TRDIR-NAME
           INTO MTAB_PROGRAM_FILE-LINE.
         APPEND MTAB_PROGRAM_FILE.
         MTAB_PROGRAM_FILE = MSTR_THEAD.
         APPEND MTAB_PROGRAM_FILE.
    *-- Put the identifier line in so that the start of the report
    *-- documentation is marked
         CONCATENATE MC_DOC_IDENTIFIER
                     MTAB_PROGRAM_TRDIR-NAME
           INTO MTAB_PROGRAM_FILE-LINE.
         APPEND MTAB_PROGRAM_FILE.
    *-- Add the report documentation
         LOOP AT MTAB_PROGRAM_DOCUMENTATION.
           MTAB_PROGRAM_FILE = MTAB_PROGRAM_DOCUMENTATION.
           APPEND MTAB_PROGRAM_FILE.
         ENDLOOP.
    *-- Make the fully pathed filename that report will be saved to
         CONCATENATE P_PATH
                     MTAB_PROGRAM_TRDIR-NAME
                     '.txt'
           INTO LC_FULL_FILENAME.
         PERFORM SAVE_TABLE_TO_FILE TABLES MTAB_PROGRAM_FILE
                                    USING  LC_FULL_FILENAME.
    *-- Write out message with Program Name/Description
         READ TABLE MTAB_PROGRAM_TEXTS WITH KEY ID = 'R'.
         IF SY-SUBRC = 0.
           MTAB_DIRECTORY-NAME = MTAB_PROGRAM_TRDIR-NAME.
           MTAB_DIRECTORY-DESC = MTAB_PROGRAM_TEXTS-ENTRY.
           MTAB_DIRECTORY-SAVENAME = LC_FULL_FILENAME.
           APPEND MTAB_DIRECTORY.
           WRITE: / MTAB_PROGRAM_TRDIR-NAME,
                    MTAB_PROGRAM_TEXTS-ENTRY(65) COLOR COL_HEADING.
         ELSE.
           MTAB_DIRECTORY-NAME = MTAB_PROGRAM_TRDIR-NAME.
           MTAB_DIRECTORY-DESC = 'No description available'.
           MTAB_DIRECTORY-SAVENAME = LC_FULL_FILENAME.
           APPEND MTAB_DIRECTORY.
           WRITE: / MTAB_PROGRAM_TRDIR-NAME.
         ENDIF.
       ENDLOOP.
    ENDFORM.                               " BUILD_PROGRAM_DIRECTORY
          FORM SAVE_TABLE_TO_FILE                                       *
    -->  FTAB_TABLE                                                    *
    -->  F_FILENAME                                                    *
    FORM SAVE_TABLE_TO_FILE TABLES FTAB_TABLE
                             USING  F_FILENAME.
       IF RB_DOS = 'X'.                  " Save file to presentation server
         CALL FUNCTION 'WS_DOWNLOAD'
              EXPORTING
                   FILENAME = F_FILENAME
                   FILETYPE = 'ASC'
              TABLES
                   DATA_TAB = FTAB_TABLE
              EXCEPTIONS
                   OTHERS   = 4.
         IF SY-SUBRC NE 0.
           WRITE: / 'Error opening dataset' COLOR COL_NEGATIVE,
                    F_FILENAME COLOR COL_NEGATIVE.
         ENDIF.
       ELSE.                                " Save file to application serve
         OPEN DATASET F_FILENAME FOR OUTPUT IN TEXT MODE.
         IF SY-SUBRC = 0.
           LOOP AT FTAB_TABLE.
             TRANSFER FTAB_TABLE TO F_FILENAME.
             IF SY-SUBRC NE 0.
               WRITE: / 'Error writing record to file;' COLOR COL_NEGATIVE,
                        F_FILENAME COLOR COL_NEGATIVE.
             ENDIF.
           ENDLOOP.
         ELSE.
           WRITE: / 'Error opening dataset' COLOR COL_NEGATIVE,
                    F_FILENAME COLOR COL_NEGATIVE.
         ENDIF.
       ENDIF.                               " End RB_DOS
    ENDFORM.                               " SAVE_PROGRAM
          FORM READ_REPORT_FROM_DISK                                    *
          Read report into internal table.  Can read from local or      *
          remote computer                                               *
    FORM READ_REPORT_FROM_DISK TABLES FTAB_TABLE
                                USING  F_FILENAME.
       DATA:
          LC_MESSAGE(128) TYPE C.
       CLEAR   FTAB_TABLE.
       REFRESH FTAB_TABLE.
       IF RB_DOS = 'X'.
         TRANSLATE F_FILENAME USING '/\'.   " correct slash for Dos PC file
         CALL FUNCTION 'WS_UPLOAD'
              EXPORTING
                   FILENAME            = F_FILENAME
                   FILETYPE            = 'ASC'
              TABLES
                   DATA_TAB            = FTAB_TABLE
              EXCEPTIONS
                   CONVERSION_ERROR    = 1
                   FILE_OPEN_ERROR     = 2
                   FILE_READ_ERROR     = 3
                   INVALID_TABLE_WIDTH = 4
                   INVALID_TYPE        = 5
                   NO_BATCH            = 6
                   UNKNOWN_ERROR       = 7
                   OTHERS              = 8.
         IF SY-SUBRC >< 0.
           WRITE: / 'Error reading file from local PC' COLOR COL_NEGATIVE.
         ENDIF.
       ELSEIF RB_UNIX = 'X'.
         TRANSLATE F_FILENAME USING '\/'.   " correct slash for unix
         OPEN DATASET F_FILENAME FOR INPUT MESSAGE LC_MESSAGE IN TEXT MODE.
         IF SY-SUBRC = 0.
           DO.
             READ DATASET F_FILENAME INTO FTAB_TABLE.
             IF SY-SUBRC = 0.
               APPEND FTAB_TABLE.
             ELSE.
               EXIT.
             ENDIF.
           ENDDO.
           CLOSE DATASET F_FILENAME.
         ELSE.
           WRITE: / 'Error reading file from remote computer'
                           COLOR COL_NEGATIVE,
                  / LC_MESSAGE,
                  / F_FILENAME.
           SY-SUBRC = 4.
         ENDIF.
       ENDIF.
    ENDFORM.                               " READ_REPORT_FROM_DISK
          FORM SPLIT_INCOMING_FILE                                      *
    -->  FTAB_PROGRAM_FILE                                             *
    -->  FTAB_PROGRAM_SOURCE                                           *
    -->  `                                                             *
    -->  FTAB_PROGRAM_TEXTS                                            *
    FORM SPLIT_INCOMING_FILE TABLES FTAB_PROGRAM_FILE
                                          STRUCTURE MTAB_PROGRAM_FILE
                                     FTAB_PROGRAM_SOURCE
                                          STRUCTURE MTAB_PROGRAM_SOURCE
                                     FTAB_PROGRAM_TEXTS
                                          STRUCTURE MTAB_PROGRAM_TEXTS
                                     FTAB_PROGRAM_DOCUMENTATION
                                       STRUCTURE MTAB_PROGRAM_DOCUMENTATION
                            CHANGING FSTR_TRDIR
                                     FSTR_THEAD.
       DATA:
         LC_DATATYPE(4) TYPE C,             " Type of data, REPO, TEXP, RDIR
         LC_PROGRAM_FILE LIKE MTAB_PROGRAM_FILE.
       LOOP AT FTAB_PROGRAM_FILE.
         LC_PROGRAM_FILE = FTAB_PROGRAM_FILE.
         CASE LC_PROGRAM_FILE(9).
           WHEN MC_TRDIR_IDENTIFIER.
             LC_DATATYPE = MC_TRDIR_SHORT.
           WHEN MC_REPORT_IDENTIFIER.
             LC_DATATYPE = MC_REPORT_SHORT.
           WHEN MC_TEXT_IDENTIFIER.
             LC_DATATYPE = MC_TEXT_SHORT.
           WHEN MC_DOC_IDENTIFIER.
             LC_DATATYPE = MC_DOC_SHORT.
           WHEN MC_THEAD_IDENTIFIER.
             LC_DATATYPE = MC_THEAD_SHORT.
           WHEN OTHERS. " Actual contents of report, trdir, or text
             CASE LC_DATATYPE.
               WHEN MC_TRDIR_SHORT.
                 FSTR_TRDIR = FTAB_PROGRAM_FILE.
               WHEN MC_REPORT_SHORT.
                 FTAB_PROGRAM_SOURCE = FTAB_PROGRAM_FILE.
                 APPEND FTAB_PROGRAM_SOURCE.
               WHEN MC_TEXT_SHORT.
                 FTAB_PROGRAM_TEXTS = FTAB_PROGRAM_FILE.
                 APPEND FTAB_PROGRAM_TEXTS.
               WHEN MC_THEAD_SHORT.
                 FSTR_THEAD = FTAB_PROGRAM_FILE.
               WHEN MC_DOC_SHORT.
                 FTAB_PROGRAM_DOCUMENTATION = FTAB_PROGRAM_FILE.
                 APPEND FTAB_PROGRAM_DOCUMENTATION.
             ENDCASE.
         ENDCASE.
       ENDLOOP.
    ENDFORM.                               " SPLIT_INCOMING_FILE
          FORM INSERT_NEW_REPORT                                        *
    -->  FTAB_PROGRAM_SOURCE                                           *
    -->  FTAB_PROGRAM_TEXTS                                            *
    -->  F_TRDIR                                                       *
    FORM INSERT_NEW_REPORT TABLES FTAB_PROGRAM_SOURCE
                                       STRUCTURE MTAB_PROGRAM_SOURCE
                                   FTAB_PROGRAM_TEXTS
                                        STRUCTURE MTAB_PROGRAM_TEXTS
                                   FTAB_PROGRAM_DOCUMENTATION
                                        STRUCTURE MTAB_PROGRAM_DOCUMENTATION
                            USING  FSTR_TRDIR LIKE TRDIR
                                   FSTR_THEAD LIKE MSTR_THEAD.
       DATA:
         LC_OBJ_NAME LIKE E071-OBJ_NAME,
         LC_LINE2(40)     TYPE C,
         LC_ANSWER(1)     TYPE C.
    *-- read trdir to see if the report already exists, if it does, prompt
    *-- user to overwrite or abort.
       SELECT SINGLE * FROM TRDIR WHERE NAME = FSTR_TRDIR-NAME.
       IF SY-SUBRC = 0.                     " Already exists
         CONCATENATE 'want to overwrite report'
                     FSTR_TRDIR-NAME
           INTO LC_LINE2 SEPARATED BY SPACE.
         CONCATENATE LC_LINE2
           INTO LC_LINE2.
         CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
              EXPORTING
                  DEFAULTOPTION  = 'N'
                  TEXTLINE1   = 'The selected report already exists, do you'
                  TEXTLINE2      = LC_LINE2
                  TITEL          = 'Report already exists'
                  CANCEL_DISPLAY = SPACE
              IMPORTING
                   ANSWER         = LC_ANSWER
              EXCEPTIONS
                   OTHERS         = 1.
       ELSE.
         LC_ANSWER = 'J'.
       ENDIF.
       IF LC_ANSWER = 'J'.
    *-- Create the TADIR entry.  (TRDIR entry created by INSERT REPORT)
         LC_OBJ_NAME = TRDIR-NAME.
         CALL FUNCTION 'TR_TADIR_POPUP_ENTRY_E071'
              EXPORTING
                   WI_E071_PGMID     = 'R3TR'
                   WI_E071_OBJECT    = 'PROG'
                   WI_E071_OBJ_NAME  = LC_OBJ_NAME
                   WI_TADIR_DEVCLASS = '$TMP'
              EXCEPTIONS
                   EXIT              = 3
                   OTHERS            = 4.
         IF SY-SUBRC = 0.
    *-- Create Report
           INSERT REPORT FSTR_TRDIR-NAME FROM FTAB_PROGRAM_SOURCE.
    *-- Create Texts
           INSERT TEXTPOOL FSTR_TRDIR-NAME FROM FTAB_PROGRAM_TEXTS
                  LANGUAGE SY-LANGU.
    *-- Save Documentation
           CALL FUNCTION 'DOCU_UPDATE'
                EXPORTING
                     HEAD    = FSTR_THEAD
                     STATE   = 'A'
                     TYP     = 'E'
                     VERSION = '1'
                TABLES
                     LINE    = FTAB_PROGRAM_DOCUMENTATION
                EXCEPTIONS
                     OTHERS  = 1.
         ELSE.
           WRITE: / 'Error updating the TADIR entry' COLOR COL_NEGATIVE,
                    'Program' COLOR COL_NEGATIVE INTENSIFIED OFF,
                    FSTR_TRDIR-NAME, 'was not loaded into SAP.'
                       COLOR COL_NEGATIVE INTENSIFIED OFF.
         ENDIF.
       ELSE.
         WRITE: / FSTR_TRDIR-NAME COLOR COL_NEGATIVE,
                  'was not uploaded into SAP.  Action cancelled by user'
                      COLOR COL_NEGATIVE INTENSIFIED OFF.
       ENDIF.
    ENDFORM.                               " INSERT_NEW_REPORT
          FORM GET_NAME                                                 *
    -->  VALUE(F_FIELD)                                                *
    -->  F_NAME                                                        *
    FORM GET_NAME USING VALUE(F_FIELD)
                CHANGING F_NAME.
       DATA: LTAB_FIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE,
             LC_PROG LIKE D020S-PROG,
             LC_DNUM LIKE D020S-DNUM.
       TRANSLATE F_FIELD TO UPPER CASE.
       refresh ltab_fields.
       LTAB_FIELDS-FIELDNAME = F_FIELD.
       append ltab_fields.
       LC_PROG =  SY-REPID .
       LC_DNUM =  SY-DYNNR .
       CALL FUNCTION 'DYNP_VALUES_READ'
            EXPORTING
                 DYNAME     = LC_PROG
                 DYNUMB     = LC_DNUM
            TABLES
                 dynpfields = ltab_fields
            EXCEPTIONS
                 OTHERS     = 01.
       read table ltab_fields index 1.
       IF SY-SUBRC EQ 0.
         F_NAME = LTAB_FIELDS-FIELDVALUE.
         refresh ltab_fields.
       ENDIF.
       CALL FUNCTION 'F4_USER'
            EXPORTING
                 OBJECT = F_NAME
            IMPORTING
                 RESULT = F_NAME.
    ENDFORM.                               " GET_NAME
    This is the entire program.hope it helops you.
    Reward if useful
    Regards
    divya

  • Servlet for downloading a file

    i am writing a servlet for downloading a file on a GET action in the form..the web-xml is deployed correctly as far as i can interpret..bt i am encountering an error during the run time..
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    here is the log file..
    Jul 11, 2008 12:07:14 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet DwnFile threw exception
    java.lang.NullPointerException
         at com.example.web.dwnfile.doGet(dwnfile.java:17)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    it has some more content bt it is just the exceptions thrwn...
    and here is my *.java file*
    package com.example.web;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class dwnfile extends HttpServlet
    public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException
    response.setContentType("/image/jpeg");
    ServletContext ctx=getServletContext();
    InputStream is=ctx.getResourceAsStream("/2004.jpeg");
    int read=0;
    byte[] bytes=new byte[1024];
    OutputStream os=response.getOutputStream();
    while ((read=is.read(bytes))!=-1)
    {os.write(bytes,0,read);
    os.flush();
    os.close();
    the bold line is whre the exception is pointing..i think..
    thanks in advance..
    Edited by: Sun_Rockz on Jul 10, 2008 7:13 PM

    response.setContentType("/image/jpeg");
    ServletContext ctx=getServletContext();
    InputStream is=ctx.getResourceAsStream("/2004.jpeg");there was an error in this part of code..the image extension of .jpeg is not allowed it seems..on changing it to jpg worked..and
    in the first line the contenttype mst not be preceded by a forward slash..
    now one more doubt relating to the same servlet..
    response.setContentType("application/x-zip");
    ServletContext ctx=getServletContext();
    InputStream is=ctx.getResourceAsStream("/servlet_spec.zip");
    if i keep this in my servlet the required action is taking place..i.e.i am gettin a download option bt the problem is tht the file is getting downloaded as a download.do file.....
    download.do is the url pattern tht i am using in my html web page..
    i tried replacing different types of allplications and files bt all are downloaded wit the same name. i.e. download.do
    so what do u think is reason behind this..
    thanks for all the replies.
    Edited by: Sun_Rockz on Jul 11, 2008 10:47 AM
    Edited by: Sun_Rockz on Jul 11, 2008 10:51 AM

  • Is it wise to keep the Nikon camera files "DSC's"  after downloading them and converting to DNG files via Adobe converter for lightroom use. In other words do the DNG files have all the raw data I would ever need in processing or should I save the camera'

    Is it wise to keep the Nikon camera files "DSC's"  after downloading them and converting to DNG files via Adobe converter for lightroom use. In other words do the DNG files have all the raw data I would ever need in processing or should I save the camera's DSC files?

    DNG files do not contain some metadata supplied by the camera, which can be used by the manufacturer's software. Thus, if you don't keep the original Raw photo, you will lose this information.
    If your 1000% sure you're never going to use the manufacturer's software, then this isn't a problem. But who can be sure what software you will be using 10 years from now?

  • How to log in background and execute a function for downloading a file

    Hello,
    i have a problem.
    I have an application with logon functionality. Over the application there is function to create a xml file for downloading it to the pc.
    Now i want to download this file in background and save it to a server.
    My problem is here how can i do this. The main problem is how to logon with the userid and password in background and how to dowload the file.
    Thanks,
    Regards,
    Ronald

    hi Ps ,
    Can you please do small sample ,
    that would help me in clear understanding
    thanks in advance
    ashok.c

  • How to provide the user with a list of files to pick from...for downloading

    hai..
    I have uploaded the file succesfully.. now we need to download the file...... which has been uploaded..... for that we have implemnted the Query as..
    select max(id) from APEX_APPLICATION_FILES ,here the latest uploaded record will be retrieved and shown.
    Now We want to provide the user with a list of files to pick from for downloading..,Dat is he should be shown the list of files which is available from dat he has to select one file to downlaod ???
    can u plz tell me how to do it....
    anoo

    Hi Anoo,
    Create a report using the following SQL statement:
    SELECT ID,
    FILENAME,
    CREATED_ON
    FROM APEX_APPLICATION_FILES
    ORDER BY CREATED_ON DESCThere are other fields available from the table, but the above gives you a start.
    Then edit the report's Report Attributes.
    Edit the CREATED_ON column and pick a Number/Date Format to use for the display and Apply Changes
    Edit the ID column. In the Column Link section, enter:
    Link Text: &lt;img src="#IMAGE_PREFIX#download.gif" alt="Download"&gt;
    Target: URL
    URL: p?n=#ID#
    Apply Changes and run your report
    Andy

  • How do I select multiple files for download at one time?

    I'm trying to batch download 24 files at one time. Firefox will only let me select one file at a time for download. Is there a way around this?

    try flash got and DTA plugins

  • When i select a pdf file for download in a webpage instead of automatically downloading the file and opening it using adobe acrobat I get a new blank window in the browser and it says done in the bottom left corner

    when I select a pdf file within a webpage and click to download instead of getting the "download" window and the file automatically opening after download using adobe reader I get a blank webpage (in the same tab) and in the bottom left corner it says"done". No file is downloaded and if I click "back" I just return to the webpage containing the link.

    Aha!  The properties for the plugin file nppdf32.dll for Adobe Reader indicate the file is for Adobe Acrobat.  This misidentification is then used by SeaMonkey as a label in the helper application list. 
    Adobe Reader 11.0.3.37:  nppdf32.dll has version 11.0.3.37.  This is the version in SeaMonkey's plugins folder. 
    Adobe Acrobat 7.0.8.218:  nppdf32.dll has version 7.0.9.50. 
    As for having both Adobe Reader and Adobe Acrobat on the same PC, this generally works providing Reader is installed AFTER Acrobat.  Reader is freeware, and I want to keep it current.  Acrobat is purchaseware, and I cannot afford to keep buying  upgrades or newer versions. 

  • Is there a way I can 'select all' for downloading purchase files via family sharing instead of selecting each file or folder one at a time?

    Is there a way I can 'select all' for downloading purchase files via family sharing instead of selecting each file or folder one at a time?

    or home sharing

  • Error in maintenence optimizer while selecting files for download for EHP4

    HI,
    We are trying to download files for upgrade of ECC (HCM) and Portal systems from EHP3 to EHP4.
    This download we are doing through the Solman 7.0. Solman is currently at 7.0 but going to be upgraded soon to EHP1.
    Problem is that after we select the files for download of ECC EHP4, in step 2.1 i.e. 'choose stack', the next screen shows error as "Only one EhP release is allowed additionally".
    Is this because the Solman is not upgraded to EHP1 yet or soem other reason?
    Please let us know.
    Thanks for your time.
    Thanks & Regards,
    Kunal.

    ..have a look at the How-To Install EHP4 Guide (http://service.sap.com/~sapidb/011000358700000293582009E.PDF)
    3.4.2 Only one EHP release is allowed
    Issue: You get the error message: u201COnly one EHP release is allowedu201D
    Reason: This problem is documented in SAP Note 1139602.
    If you get this error message, then you already have installed another SAP enhancement package on this system before (for example SAP enhancement package 3 for SAP ERP 6.0).
    The error tells you that you have chosen too few technical usages. If you continued with this selection, you would not update all of the software components to SAP enhancement package 4 that are currently on SAP enhancement package 3. So in the end, some software components would be on SAP enhancement package 3 while others would be on SAP enhancement package 4. That way you would have several SAP enhancement package versions in one system, which is a state that is not supported.
    Solution: SAP Solution Manager Maintenance Optimizer requests you to select more technical usages and proposes a list for you to choose from.
    If you implement SAP Note 1287216, then Maintenance Optimizer automatically pre-selects the technical usages that are already installed on the system. In the example here, the technical usage Central Applications has been installed on a previous version of SAP enhancement packages.
    In rare cases you still get the error after accepting what SAP Solution Manager proposes. The reason for this is that you updated software components without properly covering technical usages.
    Hope that helps - best regards,
    Christian.

Maybe you are looking for

  • Data into the Tables.

    Hi, I thought of putting my question in the forum. The question is, when we are doing some changes in the forms applications in oracle apps and save the data, is there anyway that i can know to how many and which tables the data is getting saved to??

  • Customers Transport one company code to another company code

    Dear gurus, I have customers in one company code 100, now i want to transfer all those customers to 200 company code.. how can i do... Thanks Ramki

  • Network disk drive not appearing

    I am running a wirless network from a linksys router. I have 3 macs running on this network. I purchased an ethernet disk interface for an old hard drive. I connected the drive to one of ports on the router. How do I connect to this drive? Nothing sh

  • Indesign trail in unresponsive just after launch

    I just downloaded a trial version of indesign cs6. The app will launch but will become unresponsive (spinning pinwheel) before I am able to do anything. I uninstalled and reinstalled the app. Running mac with os10.7.4.

  • Action script.. help with using components

    i need help using the list component for my text in animation. i want the component to allow viewers to scroll and view text.