How to serve runtime generated file on WAS?

Hi,
In short: where (local path on application server) should I store a file (generated at runtime) in order to be able to offer it for downloading (via WAS)?
Context: I have a BSP application and I want to generate a PDF file (in the BSP app) and store that PDF locally on the server. In which local folder do I need to store that pdf so that it will be available remotely via WAS? Is there some folder in the local system that serves as WAS root folder?
Thanks!
Jeroen

Hi,
I wouldn't open the file system of the WAS for the public and let the WAS read the file itself and serve it to the client.
Eg
Open the file
        OPEN DATASET file_path_pdf FOR input IN Binary mode message openmessage."text MODE encoding utf-8 .
        if sy-subrc <> 0.
        %>
            <%=openmessage%>
            <% mnavigation->response_complete( ).%>
        <%
        else.
            read dataset file_path_pdf inTO pdfcontent.
            CLOSE DATASET file_path_pdf.
        endif.
Give it to the browser
        runtime->server->response->set_data( pdfcontent ).
        contentsize = xstrlen( pdfcontent ).
        runtime->server->response->set_header_field( name = 'Content-Length'
                                             value = contentsize ).
        runtime->server->response->delete_header_field( name = 'Cache-Control' ).
        runtime->server->response->delete_header_field( name = 'Expires' ).
        runtime->server->response->delete_header_field( name = 'Pragma' ).
        runtime->server->response->set_header_field( name = 'Content-Type'
                                                 value = 'application/pdf' ).
Eventual delet of the file
        delete dataset file_path_pdf.
Set the reponse to complete to clear the buffers
        mnavigation->response_complete( ).
Als take care when converting to PDF that you use unique file names in case you want to keep the files.
Eddy

Similar Messages

  • In flash pro cc, how do i get the files i was working on previous session to open automatically?

    in flash pro cc, how do i get the files i was working on previous session to open automatically?

    cs4 had it 'on launch' --> last documents open, under general preferences. i don't see it in cc version, so i guess you're right. hard to understand, since it saved time.

  • How to print a PDF file that was display in my page...

    Hi !. My doubt would be the following one... I would like to know how to print a pdf file that was displayed in my page ?... I mean the PDF file not the page...
    The PDF would be in this url:
    http://iprodesa.lasegunda.com.ar:8090/datos/pdf/830.pdf
    How could I implement this ?...

    This first question which comes to mind is how do you display the pdf file in the browser?
    For this the browser uses a plug in (e.g. adobe reader) which already has the ability to print the pdf file. Depending on the version of your plug in, printing is started differently.
    Timo
    Ps: which jdev version do you use?

  • How do I recover a file what was written in the 'notes' app that I have accidentally deleted?

    how do I recover a file what was written in the 'notes' app that I have accidentally deleted?

    If you have an iTunes backup or iCloud backup containing that note you can restore from that backup.
    If you have no backups the note is gone.

  • How to delete the Generated files from application server(open hub)?

    hi experts,
    when i try to execute process chain the DTP it is giving below dump. Exception CX_RSBK_REQUEST_LOCKED logged.
    when i execute the DTP manually and trying to delete the previous request, it is giving for dump ITAB_DUPLICATE_KEY.
    so to delete the generated file from application server, how to delete it for specific dates?
    Information on where terminated
    Termination occurred in the ABAP program "GPD6S3OE0BCVGC6L9DBNVYQARZM" - in
    "START_ROUTINE".
    The main program was "RSBATCH_EXECUTE_PROZESS ".
    In the source code you have the termination point in line 2874
    of the (Include) program "GPD6S3OE0BCVGC6L9DBNVYQARZM".
    The program "GPD6S3OE0BCVGC6L9DBNVYQARZM" was started as a background job.
    and when i check the dump it is point out at below code
    " Populate the lookup table for 0STOR_LOC
    SELECT * from /BI0/TSTOR_LOC
    into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
    FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
    STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
    but the programme is syntactically correct only.
    how to rectify the issue.
    regards
    venuscm
    Edited by: venugopal vadlamudi on Sep 28, 2010 1:59 PM

    hi experts,
    We have written start routine to get the storage location text and sending to File located at Application server through OPEN HUB.
    here is the code written in the Transformations
    In the global section
    Text for 0STOR_LOC
        DATA: l_0stor_loc_text TYPE HASHED TABLE OF /bi0/tstor_loc
              WITH UNIQUE KEY stor_loc.
        DATA: l_0stor_loc_text_wa TYPE /bi0/tstor_loc.
    and in the code to get the text
    " Populate the lookup table for 0STOR_LOC
        *SELECT * from /BI0/TSTOR_LOC*
          into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
          FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
                  STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
    im sure there is problem with the Routine only. i think i need to change the code if so please provide me the modified one.
    thanks
    venuscm
    Edited by: venugopal vadlamudi on Sep 29, 2010 9:37 AM

  • How to use a ".generate" file in JDeveloper 11g ?

    hi
    Using JDeveloper 11g (11.1.1.0.1) I created a Database Diagram and dropped both SCOTT.EMP and SCOTT.DEPT tables on it, creating Offline Database Objects.
    After that I used the "Generate..." option from the right-click menu on the SCOTT Offline Database Source in JDeveloper, to generate a SQL script.
    Step 6 of 6 allowed me to "Save settings for reuse", resulting in a ".generate" file (see GenerateSQLFromDatabaseObjectsStep6Of6.png).
    question
    How should I be able to reuse such a ".generate" file, the right-click menu does not have a "Generate" option (like JDeveloper 10g has) or something similar, see GenerateSQLRightClickMenuForGenerateFile.png.
    many thanks
    Jan Vervecken

    Thanks for your reply Susan.
    You were not able to access it via metalink as it was categorized as an internal bug rather than a production version bug. Since it has now been fixed it is unlikely that I can get it changed to allow it to be seen via metalink.about "unlikely", see also ...
    ... Steve Muench : "Re: Request for "WHERE  -   IN" Combination with Bind Variables."
    ... Keimpe Bronkhorst : "Re: Generics : compiler option : unchecked conversion warnings"
    ... Brian Duff : "Re: Surround With Try/Catch : comments issue"
    ... Frank Nimphius : "Re: Jdev 11g: Warnings in structure window for jspx (makeCurrent)"
    But there is probably an explanation.
    regards
    Jan

  • How to create the SWF file which was included surrogate pairs.

    I would like to make sure how to create the SWF file which are included surrogate pairs.
    The error of outside the scope of unicode occurred when I compiled(mxmlc) the as file which was set surrogate pairs to 'Unicoderange'.
    Ex, I set the '  '(UTF-16 is '20B9F') to 'Unicoderange'.
    However, I cannot add the surrogate pairs.
    The error of outside the scope of Unicode occurred when I compiled the AS file.
    The reason of error was that the Unicode(UTF-16) of surrogate pairs is invalid.
    Then, I read the following pages.
    These pages are written that unicode-range supported surrogate pairs.
    http://livedocs.adobe.com/flex/3/html/help.html?content=fonts_07.html
    http://www.w3.org/TR/1998/REC-CSS2-19980512/fonts.html#descdef-unicode -range
    So please let me know how to create the SWF file which are included surrogate pairs.
    Environment
    - Flex3.5a
    - TTC: meiryo(ver6.02), msgothic(ver2.50), mspgothic(ver2.50)
    Thanks,
    Takeshi Ishihara.

    I've been able to create project jar files in Eclipse by selecting Export from the File menu, then choose Java - Jar file - and provide the required information, name, destination folder etc. But when I do this, I do not export other jars on the build path this way nor do I expect to do this. I am only concerned with creating a jar file of my own work. A jar file does not "contain" other jar files. If the jar file contains the main method, and requires other jars for it's execution, then you may wish to include a reference to required jars on the class path entry of the Manifest file of the jar file you create. I'm not sure how to create a Manifest file in eclipse though..

  • How do I Convert Music Files to .Was or AIFF?

    I want to burn a CD that will play on an regular CD player. How can I convert the file format of songs in my iTunes to a format that will work on such a CD player?

    This is how you create audio CDs. If it's not working then there can be a few reasons why it's not.
    burned the disk choosing "Audio CD" and the resulting CD would not play in a "regular" CD player.
    Does this "regular CD player" play CD-R? Have you played other burned CDs in it?
    Have you tried this burned CD in a different CD player? Pop it in a DVD player and see if it works.
    Does this CD play in iTunes?
    Are there any other suggestions?
    Try to burn at a slower speed.
    Try different discs.

  • Displaying Runtime Generated Files

    We have a servlet that creates Excel Spreadsheets during runtime and deposits the
    files on the server. Since the files are not part of the war file, how can I
    create a html link to display the files in a browser?

    fdfddf wrote:
    Hi, I have a requirement that need to display multiple pdf files in same jsp file..
    we are using Itext to generate PDF files.....
    i have working exp on displaying single PDF file in jsp..but not multiple pdf files..
    Can anyone suggest me how to approach...Not really no.
    What do you mean display? Are you sending PDF content directly? Because I don't think this is going to be possible to do it that way...

  • VBA How to download a generated file from IE

    Hi guys,
    Apologies if this is an easy one, I couldn't find anything that helped me with my problem and was hoping someone might point me in the right direction for which object/argument to use.
    I'm trying to automate the downloading of a report, it will be a CSV file however it's not a static address (i.e. www.hello.com/files/goodbye.csv)
    The website is a CMS with database backend and upon clicking a button, the report is generated and the user will be prompted to download a resulting file (once it has been prepared).
    It is this action that I am trying to automate, however I'm not sure how to get IE to click the button and automatically saving instead of prompting the user at all (ideally this will be done with IE Visible being false in the end).
    Any help would be greatly appreciated!
    Best regards,
    Jeff.

    You can use an API to do the work too!
    Option Explicit
    Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
    ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" ( _
    ByVal hWnd1 As Long, ByVal hwnd2 As Long, _
    ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
    ByVal hWnd As Long, _
    ByVal wMsg As Long, _
    ByVal wParam As Long, _
    lParam As Any) As Long
    Public Declare Function PostMessage Lib "user32.dll" Alias "PostMessageA"
    ByVal hWnd As Long, _
    ByVal wMsg As Long, _
    ByVal wParam As Long, _
    ByVal lParam As Long) As Long
    Public Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As
    Long) As Long
    Public Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
    Public Const TCM_SETCURFOCUS As Long = &H1330&
    Public Const BM_CLICK As Long = &HF5&
    Private Const WM_COMMAND As Long = &H111
    Sub Download()
    Dim i As Long, res As Long
    Dim hWndUI As Long, hWndBtn As Long
    Dim timeOut As Double
    Const cClsName As String = "#32770" ' same classname for all the control
    windows we'll need
    ReDim aWinText(1 To 3) As String
    aWinText(1) = "File Download - Security Warning"
    aWinText(2) = "Save As"
    aWinText(3) = "Download complete"
    ' 1, get the File download window and click Save
    ' 2, get the Save As window and click Save
    For i = 1 To 2
    hWndUI = 0
    timeOut = Timer + 5
    While hWndUI = 0 And Timer < timeOut
    Sleep 100&
    hWndUI = FindWindow(cClsName, aWinText(i))
    Wend
    If hWndUI = 0 Then
    ' eg bad url
    Err.Raise 12345, , "didn't get " & vbCr & aWinText(i)
    End If
    SetForegroundWindow hWndUI
    Sleep 100&
    hWndBtn = FindWindowEx(hWndUI, 0&, "Button", "&Save")
    Sleep 200&
    res = SendMessage(hWndBtn, TCM_SETCURFOCUS, 1, ByVal 0&)
    'res = SendMessage(hWndBtn, BM_CLICK, ByVal 0&, ByVal 0&)
    res = PostMessage(hWndBtn, BM_CLICK, ByVal 0&, ByVal 0&)
    res = SendMessage(hWndBtn, WM_COMMAND, 0&, 0&)
    Next
    ' 3, wait until Download complete appears
    hWndUI = 0
    timeOut = Timer + 10 ' increase timeOut with bigger files
    While hWndUI = 0 And Timer < timeOut
    hWndUI = FindWindow(cClsName, aWinText(3))
    Wend
    ' optional open folder
    hWndBtn = FindWindowEx(hWndUI, 0&, "Button", "Open &Folder")
    res = SendMessage(hWndBtn, TCM_SETCURFOCUS, 1, ByVal 0&)
    res = PostMessage(hWndBtn, BM_CLICK, ByVal 0&, ByVal 0&)
    ' res = SendMessage(hWndBtn, BM_CLICK, ByVal 0&, ByVal 0&)
    res = SendMessage(hWndBtn, WM_COMMAND, 0&, 0&)
    DoEvents
    End Sub
    Sub Test1()
    Dim url As String
    Dim objIE As Object
    On Error GoTo errH
    url = "http://social.microsoft.com/Forums/getfile/25241/"
    ' iso IE suggest add a WebBrowser control to a sheet or a userform
    ' and use that rather than starting an instance of IE
    Set objIE = CreateObject("internetexplorer.application")
    objIE.Navigate url
    Download
    done:
    On Error Resume Next
    objIE.Quit
    Exit Sub
    errH:
    MsgBox Err.Description
    End Sub
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • How do I relink generator files in FCP X?

    I recently moved my FCPX projects from one hard drive to another via a different computer. In doing so, I chose to Duplicate and copy referenced events. However, the titles I created are all no longer available.
    I have manually copied over the Motion Project files from the previous location but I am still getting a 4 Missing Generators message with no ability to relink them. Selecting and choosing to relink doesn't work and I'm stumped.
    Any advice?

    ~/Titles.localized/Show Effects/Show/Lower 3rd/Lower 3rd.moti“ is the Motion file that is being used.  I was able to replace the file and when I open a project all of the lower thirds are there except they are all missing the names and titles.  I
    I parsed through the .fcpevent file and found the following which seems to set the title in the effect.  Its pointing to an object with an id of 2.  But how do you get the title in the new Motion file to be the same object so that it will fill in correctly??
    <parameter name="Object" id="2" flags="8589938704">
            <parameter name="Text" id="369" flags="8606777344">
                <text>Andrew and Claudia</text>
            </parameter>
            <parameter name="Render Text" id="360" flags="8590000146" default="0" value="0"/>
            <parameter name="Face Camera" id="352" flags="8589934610" default="0" value="0"/>
            <parameter name="Layout Method" id="314" flags="12901744656" default="1" value="1"/>
            <parameter name="Right Margin" id="324" flags="12901679120" default="1024" value="1024"/>
            <parameter name="Top Margin" id="325" flags="12901679120" default="100" value="100"/>
            <parameter name="Path Options" id="329" flags="8589938704">
                <parameter name="Shape Source" id="339" flags="77326254096" default="0" value="0"/>
                <parameter name="Align to Path" id="333" flags="8589934610" default="1" value="1"/>
            </parameter>
        </parameter>

  • How to delete runtimely created file?

    Hello,
    I have created an application which create xml file at runtime. When I immediately delete it, within fraction of seconds..it is not deleting..after some time it deletes.
    Please tell me how to solve this problem.

    If you're using File.deleteOnExit(), then you would expect it not to delete immediately. Otherwise, check you close any streams reading or writing to the file before trying to delete it.

  • How to detect if a file download was OK

    Hi all,
    I would like to know if exists any way to detect if a file sent out by a servlet to a browser was succesfully saved on the client.
    At least I would be happy to know if the user pressed the "OK" button or the "CANCEL" button
    I am sending the file in this standard way:
    res.setContentType("application/octet-stream");
    res.setHeader("Cache-Control", "public");
    filename="testfile.txt";
    res.setHeader("Content-disposition","attachment;filename=" + filename);
    out = res.getOutputStream();
    int len;
    while ((len = is.read(buffer)) != -1) {
    out.write(buffer, 0, len);
    } // end of while
    is.close();
    out.close();
    where res is the javax.servlet.http.HttpServletResponse
    buffer is a byte buffer and is a java.io.InputStream
    The point is that when this code is executed it reaches the end BEFORE
    the user presses any button on the save file dialog box. Perhaps is way the files are little files....
    thanks in advance,
    Andrea

    I don't think so. I mean, you can be sure you sent to the client, but not that the client received it OK

  • HT1461 How to Open a PDF file (that was sent to me via email) on windows 7 side of MacBook pro

    Please help fast

    One more reason to get people to use something other than a Mac where everything is exptected to be done for you.
    And asking for "fast help"? what is with that.Never learning to use search engines or darn... Windows will ask what you want to open a file with and search also.
    I think email attachments even pdf be sure who and expected it,, and they should be saved to a file.

  • How do i find a file that was saved to itunes from turbotax for ipad?

    i used the turbotax 2011 app do to my taxes last year.  the returns were saved to itunes.  i cannot find them in itunes.  any suggestions?

    It is wierd that Apple wants you to use iTunes for everything regarding content on our iDevices but then they add a Video App to the iPhone, iPad and we are just supposed to understand after years of training to use iTunes that our purchased videos are here and not in iTunes. 
    I initially assumed that the Video App was for watching videos I shot using my camera app.  But noooo!!, They are in the Camera Roll.

Maybe you are looking for