Downloading BLOB from DB to local filesystem

We have a requiremnt to provide a JSP page that allows user to select a file that is stored as a BLOB in an Oracle 9 DB and download to local machine.
We have the listing of files working, but not 100% sure how to go about the actual file download code. Can anyone point us in the right direction? Sample code?
Oracle 9i DB
JDev 9.052
Java 1.4
Thanks,
Mike

Thanks, Francois.
Is there another way?
Basically, what our users want is to open pdf document stored as a blob column.
My idea was to save document to AS and then open it using web.show_document().
I would like to avoid saving file to clients PC and reduce network traffic.
Mario
Message was edited by:
MarioK

Similar Messages

  • Downloading BLOB from a table.

    Hello,
    First I want to say thatnks for such a great tool like HTMLDB.
    Question is:
    How do I download BLOB from a table. What I am trying to do is. I am uploading files to a default HTMLDB location (wwv_flow_file_objects$) and moving the records to different table (delete file from wwv_file_objects$). Then I would like to be able to download that blobs from a DB by following some link. And I need it to be secure, user have to authenticate to do it. I got to the point where I created process (before header) to download the file. But I am having hard time passing some variables to that process in URL. Can some one advice me on the best practice of doing it. And also if it is a right thing to use before header process to put my own header and start uploading blob in html db. The main reason I do not whant to use DAD for that is simple security issue and ability of storing of the BLOBs only in one table. I prefer to upload it to a temporary location and then move it to other table(s). Then I need to be able to retriev the files back from those tables without moving them around.
    Any help is greatly appriciated

    i think i see what you're asking, but i'll step through the pieces just to make sure i cover your issue:
    it sounds as if you have a procedure that successfully calls wpg_docload.download_file to get your blob out of your images table. for this explanation, lets just say your images table has the same table structure as wwv_flow_files created with something like...
    create table myfiles as select * from wwv_flow_files where rownum < 3;
    ....and let's say your download proc that passed the blob from your myfiles table to wpg_docload.download_file looked something like...
    create or replace procedure getmyfile(
    p_id in varchar2,
    p_mime_type in varchar2 default null)
    as
    l_lob blob;
    l_mimetype varchar2(48);
    l_mime_charset varchar2(255);
    l_filename varchar2(400);
    begin
    select mime_type, blob_content, filename, file_charset
    into l_mimetype, l_lob, l_filename, l_mime_charset
    from myfiles
    where id = p_id;
    if l_mime_charset is not null then
    owa_util.mime_header( l_mimetype, FALSE, l_mime_charset );
    else
    owa_util.mime_header( l_mimetype, FALSE );
    end if;
    htp.p('Content-length: ' || dbms_lob.getlength( l_lob ));
    htp.p('Content-Disposition: attachment; filename="' ||
    wwv_flow_utilities.escape_url( p_url => l_filename, p_url_charset => 'utf-8') || '"');
    owa_util.http_header_close;
    wpg_docload.download_file( l_lob );
    end;
    ...then it sounds as if this is where you start running into issues. to be able to call this procedure from the url, you'd have to grant execute on your getmyfile proc to the db user that your modplsql DAD uses to access your db. once that user was given access to run getmyfile, you could access your files in myfiles by calling a URL like...
    http://myserver.com/pls/mydad/myschema.getmyfile?p_id=1005529367869246
    ...where p_id is the unique id associated with your blob in getmyfiles (you could, of course, use whatever method you want to uniquely identify that file and adjust your select-into statement w/in your getmyfile procedure). so that's all fine and dandy, but it sounds as if you want users to have to authenticate into your html db application before they can access a blob in your images table. it also sounds as if you're on the right track to do so by putting your procedure call in a before_header html db process. you could quite easily call your getmyfile procedure in such an html db pl/sql before_header process with something like...
    begin
    getmyfile (p_id => 1008411584930314);
    end;
    ...which would cause your page to just show the blob associated with the id you passed to getmyfile. because you're now accessing your blob table through html db parsing as your application schema owner, you'd no longer need to grant execute on getmyfile to your modplsql DAD's db user. that eliminates most of the security hole to which you were referring. now that you're calling getmyfile from w/in an html db process, you can take advantage of all the other html db perks such as applying conditions and an authorization scheme to the html db process to really lock things down. finally, you asked about firing your process before_header versus other firing points. before_header is a good way to go, but if you really wanted to execute other procedural logic on your page before showing the blob (and you didn't want to implement that code as before_header processes that fire sequentially before your getmyfile call),you could just throw an htp.init in right before your getmyfile call to clear out your http buffer like so...
    begin
    htp.init;
    getmyfile (p_id => 1008411584930314);
    end;
    ...hope this helps,
    raj

  • Download data from Screen to local disk

    Hi all,
      I have developed a Module pool program. I want to download the data from Screen to local disk in Word format.
    Example :-
    Name XYZ       Surname ABC     Date of Birth  00/00/9999
    Address XXXXXXXXX
    Number of Dependent
    1)  ABC      LLL          CCC    00/00/0000
    2)  XYZ      ABC          XXX    00/00/0000
    3)  ABC      LLL          CCC    00/00/0000
    Is there any function module which does this
    Thanks in Adv

    Hi,
    the simplest and easiest answer that I can think of is :
    1. Press Ctrl Y.
    2. Select the area of the screen you want.
    3. Press Ctrl C
    4. Press Ctrl V on your word document.
    5. :-).
    Regards,
    Anand Mandalika.
    P.S. Alternatively, you can use the print screen option on your keyboard.

  • Download BLOB from report

    Hi,
    I would like to add a download link into a report for each row so that the user can download a BLOB. I have created a column in which to add a column link which when clicked will provide a popup which gives the user a choice of whether to save or open the file.
    I can get this to work on a static file by adding "p?n=7101305566584499" to the URL field in the column link section or the report column, but cannot get it to work on a dynamically-created file. I have written a procedure to create a file of the BLOB and can get the BLOB to be opened in the browser if I add to the URL field: "#OWNER#.fossilapp_pkg.download_image_jpeg?p_image_id=#Download#" - I know, therefore, that both the file-generating procedure and the reference to it work. However, I don't want the image to be opened in the browser, but instead would like a popup to appear asking the user to save or open the file.
    If I put "p?n=#OWNER#.fossilapp_pkg.download_image_jpeg?p_image_id=#Download#" into the URL field I get the following error when I click on the column link: "The requested URL /pls/apex/p was not found on this server."
    Any ideas?
    Thanks,
    Lucy

    Hi,
    I have found the problem - very simple really! I copied and modified a custom download procedure from somewhere on the forum and I have just noticed that 'Content-Disposition' was incorrectly spelled as 'Content-desposition'. Correcting this error means it now works!
    Thanks for your help - yes, what you had on your website was exactly what I required. Sorry for adding random stats into it, though it was nice to 'win' £100,000! I couldn't find an obvious way to delete the stats I had added, but feel free to delete them and my profile (username=Lucy).
    Cheers,
    Lucy

  • Patching: HTTP errors when downloading blobs from proxy controller to agent

    Hi all,
    I have a persistent issue which I can't figure out. Oracle support aren't much help.
    When applying a Recommended Baseline patchset to our managed Solaris 10 servers, I have observed that blobs are downloaded to the target servers at a rate of 1-2 blobs per minute. I consider this to be quite slow, but that's not my main problem.
    At some point during the blob downloads, http errors start appearing in /var/scn/update-agent/logs/error.log on the target server....
    HTTP request failed. Reason: Moved temporarily.
    HTTP request failed. Reason: Bad gateway.
    Eventually, the blob download job fails completely...
    118099456 Download aborted.
    Our servers are quite a way behind in their patching levels. Consequently, we often need to apply as many as 200 patches to a single server. We are lucky to download 100 patches (blobs) before the http errors begin.
    The errors would seem to indicate that the http servers on the proxy controllers are refusing any further connections midway through the blob downloads. I have tried tweaking the httpd.conf file on the proxy controllers - increased the number of httpd processes running and increased MaxClients to 100. None of this has helped.
    The proxy controllers have interfaces on the same subnet as the target servers. Network performance between proxy and asset is good.
    Has anyone else experienced similar issues with patching ?
    Does anyone have any suggestions for httpd.conf settings on the Proxy Controllers ?
    Cheers,
    Graham

    So I have figured out the issue and as Eddie mentioned it is because the email attribute is not synced.  For some reason when I go into Manage User Profiles I am unable to edit anything, i.e. I cannot add the email address.  
    I am able to create a whole new user, which I did (already existed in AD) and of course included the email attribute.  When I sign into sharepoint with this user I am then able to view IRM protected documents.
    I cannot figure out why the email attribute is not synced to SP.  As mentioned above it seems the UPS does not work in a standalone SP install, but my undesrtanding is that when i sign into SP it is going to AD to autheticate, so why then does it not
    also retrieve the email attribute as well?
    I created an SharePoint Active Directory Import job, it runs successfully, it imports all my users from AD, but again without the eamil attribute!  Very strange.  If anyone has any clues I am all ears.

  • Converting from global to local filesystem

    Hi all, I have a 2-node cluster running Sun Cluster 3.2 in which multiple file systems are currently marked as global file systems (ie the file systems are visible from both nodes and they all have the "global" keyword in /etc/vfstab). I've been requested to turn these (global) file systems into "local" file systems.
    Is this done by removing the keyword "global" from /etc/vfstab for each file system on both nodes and then rebooting each node?
    Thanks in advance,
    Stewart

    Hello,
    yes, by removing the global flag until the next mount of that vfstab entry.
    You can check it in the output of the mount command for that FS.
    HTH,
    jono

  • Database Refresh From ASM Filesystem to Local Filesystem

    Hi ALL,
    I am performing a database refresh from production server to a demo server. Our Production database is 11.2.0.1 and it is using ASM filesystem to keep the data, redo and other files in ASM disks.
    On the other hand demo server is not having ASM, all the database files are stored in a local filesytem.
    I have taken a fresh backup of our production database, but I am not sure to perform the restore part as the demo server is not having ASM.
    Can anyone suggest me how to perform this, I mean datafile restore from ASM to local filesystem.
    Any usefull links will be helpful.
    Regards,
    Arijit

    Hello,
    You can restore the backup of your Production database which is using ASM to your demo server (using file system).
    Make sure that the control_files parameter in the pfile/spfile is pointing to the file system location where you want to have contol files located on the demo server.
    Next, before you use the restore command to restore the database, provide the location of the datafile where you need to restore using the "set newname" clause.
    run
    set newname for datafile 1 to '<file-system-location-on-demo-server>';
    set newname for datafile 2 to '<file-system-location-on-demo-server>';
    restore database;
    switch datafile all;
    recover database;
    }

  • Download file from button

    Hi Guys,
    I followed thread 214709 (download blob from table) and had similar code in my Portal app. I have a stored procedure with almost identical code. My page has a drop down list which shows the last 12 sales files a customer can download. Behind it I have a Download Button.
    The procedure gets executed but the download window does not show up. If I put the call in a before header it actually works so nothing is wrong with the code. Where do I have to put the call and do I have create an additional branch. After download theu user should stay on that page. I actually have 3 sections with 3 buttons to download or request a file to be emailed.
    So my last question is what is best practice in this situation.

    the thread you followed...
    Downloading BLOB from a table.
    ...showed you how to make a procedure similar to our P procedure that's used to fetch blobs out of a document table. once your file download procedure works, you can call it from the web in one of three main ways:
    1) using an image tag as shown in File Upload ( again! )
    2) using an anchor tag as shown at the top of File download-upload
    3) directly calling it from the URL. this is effectively the same thing as clicking on a link from an anchor tag in number 2, above.
    it sounds as if your download procedure's working because you said it works if you call it before_header. i'm gathering from your post that you are currently trying to call your download procedure in some kind of after submit process. you're finding that your procedure's executing, but you don't see your file. i just set up a test case for this and found that if my page didn't have a branch on it, my after_submit process did render my image correctly. it doesn't sound as if this is what you're shooting for, though. it sounds as if you just want a select list that allows users to select a particular doc. after selecting a doc and clicking a button on your page, the user is allowed to download the doc while still being left on your original page. if so, how about creating a button that calls a javascript procedure that checks the value of your select list and returns a rendering of that image? if that's what you're after, you could do it by adding javascript like...
    <script language="JavaScript" type="text/javascript">
    function viewSelImage (theItem)
    var selVal = document.getElementById(theItem).value;
    var url;
    url = 'getmyfile?p_id=' + selVal;
    location.href=url;
    </script>
    ...which, of course, assumes your document download procedure is publicly executable and named "getmydoc". it also assumes that getmydoc accepts p_id which corresponds to your document table. then, assuming your select list item is called P1_MY_IMAGE_IDS, you could add a button to your page that has a URL target of...
    javascript:viewSelImage('P1_MY_IMAGE_IDS');
    ...and that would popup a call to your document download procedure while leaving the user on the same page... which i believe is what you're after.
    hope this helps,
    raj

  • Will download message from my IMAP ACCOUNT BUT STOPPED DOWNLOADING FROM MY POP ACCOUNT ON THE SAME SERVER

    I have multiple servers I download mail from- will download messages from gmail to local folder
    was downloading for multiple users on a server with pop and stopped downloading a week ago for-
    will download from same server using imap but prefer pop to delete message on server-
    may have happened when computer system crashed

    I am downloading multiple gmail accounts using pop without issue. So we need to look further.
    Do you get any error messages?

  • Download Graphics from SAP

    Hi,
    I am bit curious to know, Is there any standard program or process to download Logos (bitmaps) from SAP into local system.
    We have logos in our SAP system. So i would like to download them from SAP into local drive.
    Thanks,
    Subba.

    Hi,
    Try FM's from the Function Group GRAP.
    Especially the FM's
    GRAPH_RECEIVE.
    Hope this helps...
    Lokesh
    Pls. reward appropriate points

  • (fileSystem::extract Blob From Local Path) after installing B.O. XI 3.1

    Hello,
    I've installed B.O. XI 3.1 client tool on a laptop, but when I try to run Designer, or Deski the following error occurs (REPOSITORY ERROR (fileSystem::extract Blob From Local Path) file not found) and the application quits.
    Anyone has an idea?

    Hi
    What operating system are you using on your laptop?
    I have a colleague having a similar problem using Windows Vista, whereas I am fine (using XP).
    Did you manage to resolve this issue? (And if so, how)
    regards, Lara

  • Download doc problem when copied from APEX_APPLICATION_FILES to local table

    Good morning!
    As the subject indicatesm, I am experiencing problems downloading a document I have copied from APEX_APPLICATION_FILES to my local table FILE_SUBJECTS
    and would be very grateful if someone could help.
    Here is the problem:
    I can successfully upload a document into APEX_APPLICATION_FILES and dowload it from there too.
    I can copy the record from APEX_APPLICATION_FILES into my local table FILE_SUBJECTS and delete that entry from APEX_APPLICATION_FILES but I cannot download it from my local table, it keeps pointing me to a page which cannot be found, so I'm guessing there is something wrong with either, my INSERT INTO statement or, my link in the report.
    My INSERT INTO statement is:
    INSERT INTO file_subjects (id,filename,updated_by,updated_on,blob_content,mime_type)
    SELECT id, filename, name, updated_by, updated_on,blob_content,mime_type
    FROM APEX_APPLICATION_FILES
    WHERE APEX_APPLICATION_FILES.filename = :P2_FILE_NAME;
    REPORT LINK
    I have tried just a normal column link in my report like: #ID# (this works when looking at APEX_APPLICATION_FILES)
    but I have also tried the following:
    #OWNER#.DOWNLOAD_MY_FILE?p_file=#ID#
    where download_my_file is a procedure:
    create or replace PROCEDURE "DOWNLOAD_MY_FILE" (p_file in number) AS
    v_mime VARCHAR2(48);
    v_length NUMBER;
    v_file_name VARCHAR2(2000);
    Lob_loc BLOB;
    BEGIN
    --apex_application.g_flow_id := 166;
    --if not(APEX_CUSTOM_AUTH.IS_SESSION_VALID) then
    -- owa_util.status_line(404, 'Page Not Found', true);
    -- return;
    --end if;
    SELECT MIME_TYPE, BLOB_CONTENT, name,DBMS_LOB.GETLENGTH(blob_content)
    INTO v_mime,lob_loc,v_file_name,v_length
    FROM FILE_SUBJECTS
    WHERE id = p_file;
    -- set up HTTP header
    -- use an NVL around the mime type and
    -- if it is a null set it to application/octect
    -- application/octect may launch a download window from windows
    owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );
    -- set the size so the browser knows how much to download
    htp.p('Content-length: ' || v_length);
    -- the filename will be used by the browser if the users does a save as
    htp.p('Content-Disposition: attachment; filename="'||replace(replace(substr(v_file_name,instr(v_file_name,'/')+1),chr(10),null),chr(13),null)|| '"');
    -- close the headers
    owa_util.http_header_close;
    -- download the BLOB
    wpg_docload.download_file( Lob_loc );
    end DOWNLOAD_MY_FILE;
    Many thanks in advance!
    Sue

    Sue,
    If you are running XE or running with the EPG versus the http server, you need to grant access to the procedure you are using for it to be run properly..
    You may need to look at this function, if you are using XE or have the EPG setup for your database.. http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e12856/adm_wrkspc.htm#BABEFDHI [Look for the section called *Restricting Access to Oracle Application Express by Database Access Descriptor (DAD)*]
    Thank you,
    Tony Miller
    Webster, TX

  • How to download files from Application Server of Unix o.s to local director

    Hi All,
    I am trying to download files from Apllication server of Unix operating Systems to local file in excel sheet format using a z-program.but whenever I am trying to use OPEN dataset ........
    it is showing sy-subrc = 8.
    Can I have any clew please.
    Thanks in advance,
    Regards,
    AMEER.

    Hi Sreekanth,
    Thanks a lot for quick reply.I have to download that files from z-program only. I am giving you my code below.
    *& Report  ZTRAK_DOWNLOAD                                         *
    REPORT  ZTRAK_DOWNLOAD  MESSAGE-ID ZCT                   .
    SELECTION-SCREEN BEGIN OF BLOCK DOWNLOAD WITH FRAME TITLE TEXT1.
      PARAMETERS :
           SERDIR LIKE RLGRAP-FILENAME DEFAULT '/usr/trak',
           LOCDIR LIKE RLGRAP-FILENAME DEFAULT 'C:\Trak'.
    SELECTION-SCREEN END OF BLOCK DOWNLOAD .
    SELECTION-SCREEN BEGIN OF BLOCK INFO2 WITH FRAME.
           SELECTION-SCREEN COMMENT 1(79) TEXT2.
           SELECTION-SCREEN SKIP.
           SELECTION-SCREEN COMMENT 1(79) TEXT3.
    SELECTION-SCREEN END OF BLOCK INFO2 .
    SELECTION-SCREEN BEGIN OF BLOCK INFO3 WITH FRAME.
           SELECTION-SCREEN COMMENT 1(79) TEXT4.
           SELECTION-SCREEN SKIP.
           SELECTION-SCREEN COMMENT 1(79) TEXT5.
            SELECTION-SCREEN SKIP.
           SELECTION-SCREEN COMMENT 1(79) TEXT6.
           SELECTION-SCREEN SKIP 1.
           SELECTION-SCREEN COMMENT 1(79) TEXT7.
           SELECTION-SCREEN SKIP 2.
           SELECTION-SCREEN COMMENT 1(79) TEXT8.
    SELECTION-SCREEN SKIP 1.
           SELECTION-SCREEN COMMENT 1(79) TEXT9.
    SELECTION-SCREEN END OF BLOCK INFO3.
    *- Internal Table to output data in Excel
    DATA: BEGIN OF tab_excel OCCURS 0,
            col1(50),
            col2(132),
            col3(255),
            col4(100),
            col5(100),
            col6(50),
            COL7(60),
            col8(30),
            col9(30),
            col10(30),
            col11(20),
            col12(15),
            col13(15),
          END OF tab_excel.
    DATA: FILE LIKE RLGRAP-FILENAME .
    DATA: W_DATASET(80).
    INITIALIZATION.
      TEXT1  = 'Download Reports'.
      TEXT2 = 'The Program downloads the reports generated by Trak'.
      TEXT3 = 'Utility from Server to Local PC.'.
      TEXT4 = 'Check the following before executing the Program.'.
      TEXT5 = '     1. A valid Server path is provided.'.
      TEXT6 = '     2. A valid Local PC path is provided.'.
      TEXT7 = '     3. Local PC has 10 MB free space.'.
      TEXT8 = 'The report can be executed in the forground.'.
    TEXT9 =
    'The report should be executed after execution of Transaction TRAK'.
    AT SELECTION-SCREEN.
    IF SERDIR EQ ''.
    MESSAGE E001(ZCT).
    ENDIF.
    IF LOCDIR EQ ''.
    MESSAGE E002(ZCT).
    ENDIF.
    START-OF-SELECTION.
    Download ABAP Development Summary Report
    FILE =  '\ABAP_Report_Developments.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/ABAP_Report_Developments.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download BDC Development Report
    FILE =  '\BDC_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/BDC_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Development Summary Report
    FILE = '\Developments_Summary_Report.XLS' .
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Developments_Summary_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Enhancement Development Report
    FILE =  '\Enhancement_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Enhancement_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download field exit Development Report
    FILE =  '\Field_Exit_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Field_Exit_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Frequency & Purpose Report
    FILE =  '\Frequency_And_Purpose_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Frequency_And_Purpose_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Function Group Developments Report
    FILE =  '\FunctionGroup_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/FunctionGroup_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Function Module Developments Report
    FILE = '\FunctionModule_Developments_Report.XLS' .
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/FunctionModule_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Include Developments Report
    FILE =  '\Include_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Include_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download UserGroup Developments Report
    FILE =  '\UserGroup_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/UserGroup_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Modified_Standard_SAP_Objects_Report
    FILE = '\Modified_Standard_SAP_Objects_Report.XLS' .
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Modified_Standard_SAP_Objects_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Include Developments Report
    *FILE =  '\Include_Developments_Report.XLS'.
    *CONCATENATE LOCDIR FILE INTO FILE.
    *W_DATASET = '/Include_Developments_Report.dat'.
    *CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    *PERFORM INIT.
    Download SAP Script Developments Report
    FILE =  '\SAP_Scipt_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/SAP_Scipt_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Transaction Developments Report
    FILE =  '\Transaction_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Transaction_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download User Exits Developments Report
    FILE =  '\UserExits_Reports.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/UserExits_Reports.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download ABAP Query Developments Report
    FILE =  '\ABAPQuery_Developments_Reports.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/ABAPQuery_Developments_Reports.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Functional Area Developments Report
    FILE =  '\FunctionalArea_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/FunctionalArea_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    MESSAGE S003(ZCT) WITH LOCDIR.
    END-OF-SELECTION.
    This routine checks whether file exists if yes downloads it to
    the Local PC
    FORM INIT.
    OPEN DATASET W_DATASET FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    DO.
       IF SY-SUBRC <> 0.
          EXIT.
       ENDIF.
       READ DATASET W_DATASET INTO  tab_excel.
       APPEND tab_excel.
       CLEAR tab_excel.
    ENDDO.
         PERFORM DOWNLOAD_FILE.
    ENDFORM.
    This routine downloads the data in an XL format on local PC
    FORM Download_File .
      CALL FUNCTION 'WS_DOWNLOAD'
                EXPORTING
                     FILENAME                = FILE
                     FILETYPE                = 'DAT'
                TABLES
                     DATA_TAB                = tab_excel
                EXCEPTIONS
                     FILE_OPEN_ERROR         = 1
                     FILE_WRITE_ERROR        = 2
                     INVALID_FILESIZE        = 3
                     INVALID_TYPE            = 4
                     NO_BATCH                = 5
                     UNKNOWN_ERROR           = 6
                     INVALID_TABLE_WIDTH     = 7
                     GUI_REFUSE_FILETRANSFER = 8
                     CUSTOMER_ERROR          = 9
                     OTHERS                  = 10.
        IF sy-subrc <> 0.
         message ''.       " Error in file transfer
        ELSE.
          CLEAR TAB_EXCEL.
          REFRESH TAB_EXCEL.
          FILE = ''.
          W_DATASET = ''.
        ENDIF.
    ENDFORM.
    I have created those files in Application Server running in another z-program in background mode.Then I am trying to download those files using above the program.I am creating those trak/Trak files manually and I can able to see those files in A.S level.But when downloading the same files I am facing the problem.
    regards,
    Ameer

  • Displaying files from a local filesystem not in Webserver Root

    I have been attempting to display a file from a local filesystem with no luck. Is there any way, with something like UTL_FILE, to read in a file (A pre-generated report from Funnel Web) and display it through a custom portlet? I have created a provider/portlet to use, however, I cannot seem to find the right combination of PL/SQL to accomplish this task. I am by no means a PL/SQL guru. Any suggestions would be welcome.
    Thanks.

    You can use URL component in the applications tab,for this purpose.
    (Create a URL component with URL pointing to ur local file system, which is under web server directory.)

  • Downloading data from a BLOB Field using mod_plsql

    Hi,
    I am trying to use the mod_plsql to download data from a blob field, I have a web page where I can pick the file name to be downloaded from the documents table This table has the BLOB field that has the Data formatted in a text file format(contains carriage returns), when I open it up in the browser it is displaying it correctly , but when I right click on the file name and choose "Save Target As" and save it as text file it is ignoring the carriage returns and displaying entire blob in one line.
    Can somebody help me figure out why it's not recognizing the carriage returns?
    Any help would be greatly appreciated.
    Thanks

    Hi and welcome to the forum.
    Is there a way to retrieve data from a blob field and save it to temp table.Why would you want to do that?
    Can you provide some more details regarding your requirement?
    (Don't forget to mention your database version as well)
    Also, I wonder why you've added a 'decompress' tag to your question?
    edit, after seeing Tubby's reply
    Dang, the connection must be frozen here ;)
    Edited by: hoek on Jan 6, 2010 9:06 PM

Maybe you are looking for

  • Purchase Requisition item Text

    Sir, IN PR WHEN I IGO TO ITEM DETAILS in TEXT TAB 1 Item text 2 item note 3 Delivery Text 3 material Po text were are the inputs reflected Regards

  • NEXT RECORD KEY

    FORMS50: Its possible to use the SCREEN-UP, SCREEN-DOWN buttons to navigate in the table. FORMS60: Not defined How can I get the same behaviour?

  • Rectangular region of osccilating blue and beige (yellowish) pixels

    I have a white Macbook (Mac OS X Tiger). Recently, I've noticed a strange rectangular region near the left side of my Macbook LCD display partly filled with oscillating blue and beige pixels. At first it was only a few pixels (and a small region) so

  • New To Command Prompt

    Hi. I've been using NetBeans for as long as I can remember, so I've never really need to do the whole javac filename.java in the command prompt. Well, now I'm trying to do an applet, and nothing I do works. 1.) I compiled WelcomeApplet.java using Net

  • I have dowloaded trial version of illustrator CC but cant open to use?

    hi there, I have just downloaded the trial version of illustrator CC but cant open the file can you help please?