Save file from server cache in WebUI

Hello,
maybe someone here can help me with this obscure problem, that bothers me for quite some time now:
I want to save a pdf file from an internal table to the clients harddrive. Everything is implemented as in Thomas Jung's BLOG(forgot the link) on getting the table in the server cache and I do have my working download URL.
Now for the difficult stuff: I need to get the file to download correctly without freezing the application.
This are the ways I tried, but I always do end up with the loading icon in front of my page, not able to make any input. gv_download_url is my working URL, file is OK too when I open it on the hdd:
1.
  <iframe src="<%= gv_download_url%>" width="0" height="0" id="PDFDownload"
          name="PDFDownload" style="display:none">
  </iframe>
2.
<p>
  <object data="report.pdf" type="text/unicode" width="1" height="1">
    <param name="src" value="<%= gv_download_url %>">
    Ihr Browser kann das Objekt leider nicht anzeigen!
  </object>
</p>
3.
<script type="text/javascript">
function pageLoaded(){
var myFrame = document.createElement("iframe");
var src = document.createAttribute("src");
var height = document.createAttribute("height");
var width = document.createAttribute("width");
src.nodeValue = "<%= gv_download_url%>";
height.nodeValue = "600";
width.nodeValue = "800";
myFrame.setAttributeNode(src);
myFrame.setAttributeNode(height);
myFrame.setAttributeNode(width);
var output = document.getElementById("Bereich");
output.appendChild(myFrame);
document.close();
</script>
<div id="Bereich"/>
<iframe src="about:blank" onload="pageLoaded()" height="0" width="0"/>
The only working way I know is this one:
<script langugage="Javascript">
  var win = window.open("<%= gv_download_url%>");
</script>
But I always end up with an empty browser page open, whicht the user has to close manually.
<i>Short: URL is good, file data is good. How do I get the file download dialog without freezing WebUI?</i>
Any help would be highly appreciated. Thanks in advance.

Had the chance to test it in IC WebClient on CRM4.0 today. Everything works fine.
It seems to be really WebUI specific then. Suppose some missed JavaScript event, that triggers the "Please Wait"-Icon.

Similar Messages

  • How to save file from server to client machine

    Hi,
    By using POI library i'm writing values to the existing excel sheet which is available in server. After i written values to the excel, i want to save the same file to the client machine.
    How to achieve this.
    I googled about this, but still i didn't get any clear idea.
    Thanks in advance,
    SAN

    Sameera,
    No, i can't understand what is the meaning of the following code:
    public void doDownload(FacesContext facesContext, OutputStream outputStream) {
    // write the neccessary code to get the download data from the Model
    String data = getDownloadData();
    // save to the output stream
    try {
    OutputStreamWriter writer = new OutputStreamWriter(outputStream,"UTF-8");
    writer.write(data);
    writer.close();
    outputStream.close();
    } catch (IOException e) {
    // handle I/O exceptions
    can you please explain this code little more.
    Edited by: san-717 on Feb 29, 2012 2:30 PM

  • Access/download file from server.

    have a problem. When I am trying to save/open a file from server(secure) which uses HTTPS, its displaying error message:
    Internet Explorer cannot download ...File_name.doc from Server_name.
    Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
    My code is below. Please help me out.
    Its working with my localhost(http) and with Firefix browser. Its something to do with http and IE 6.
    <java>
    if (!request.getScheme().equals("https"))
    response.setHeader("Pragma", "no-cache");
         String fileName=request.getParameter("instruction");
         //filename = filename.replaceAll( "\\W*", "" ) ;
         String DirName = request.getParameter("directory");
         String value = (DirName+"/"+fileName);
                   File f = new File (value);
                   response.setContentType("application/msword");
                   //set the header and also the Name by which user will be prompted to save
                   response.setHeader("Content-disposition", "attachment; filename=" + fileName);
                   InputStream in = new FileInputStream(f);
                   out.clearBuffer();          
                   int bit = 256;
                   int i = 0;
                   try {
                        while ((bit) >= 0) {
                             bit = in.read();
                             out.write(bit);
                   } catch (IOException ioe) {
                        ioe.printStackTrace(System.out);
                   out.flush();
                   out.close();
                   in.close();     
    </java>

    HI,
    To avoid redirection, Safari users are having good luck with Open DNS Free / Basic
    Carolyn

  • Collaboration: DW overwriting files from local cache?

    How do I keep Dreamweaver from overwriting newer files on the
    server, wen those files were changed by another user?
    I have a PHP-driven site built for a client. i do most of the
    maintenance, but the client needs to update the text of some pages
    frequently as information changes rapidly. So, she edits the pages
    in DW.
    The problem is that often I'll change file A myself, and then
    when she edits file B, DW will quietly overwrite file A with an old
    version. I changed her setup to an ftp-only site (no local copy),
    and the problem actually got worse ... now it overwrites all files
    with old version EVERY time she saves any file! The best I can tell
    is it uses some hidden local cache, and always overwrites server
    files from the cache, even when the server file is newer.
    Is it possible to disable the cache? This client is on DW 8.
    Thanks.

    Evan Dorn wrote:
    > How do I keep Dreamweaver from overwriting newer files
    on the server, wen those
    > files were changed by another user?
    It sounds as though what's happening is that the other person
    is
    selecting the option to upload dependent files.
    I don't have Dreamweaver 8 installed any more, but the option
    that
    controls the upload of dependent files is in Preferences
    (Edit menu on
    Windows, Dreamweaver menu on a Mac). I'm pretty sure it works
    the same
    way as in CS4. Select the Site category, and uncheck both
    options for
    Dependent files.
    David Powers
    Adobe Community Expert, Dreamweaver
    http://foundationphp.com

  • How to download a file from server machine to client machine using jsp

    Hi,
    In my application, I have an excel file stored on my server machine. How can I download that excel file on to my client machine using jsp. Is there any other way I can open that file from my machine and save it in my machine using jsp/java?
    Its an emergency for me to do this.
    Can anyone provide me the full code to download a file from server machine as I don't have
    time to browse through various sites.
    thanks in advance,
    Tiijnar

    Please post your code using code tags (click on CODE above the text area, when posting)
    response.setContentType("application/octet-stream");Why octet-stream? Set the correct mime-type.
    String disHeader = "Attachment; Filename=\"filename\"";The filename should just be the file's name. Not the complete path to the file! This will tell anyone where the file is located on the server. It's also inconvenient because by default,the browser will suggest it as the name for the download.
    Your way of writing to the output stream is just plain wrong. See this snippet (picked from [http://balusc.blogspot.com/2007/07/fileservlet.html])
            BufferedInputStream input = null;
            BufferedOutputStream output = null;
            try {
                // Open streams.
                input = new BufferedInputStream(new FileInputStream(file), DEFAULT_BUFFER_SIZE);
                output = new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE);
                // Write file contents to response.
                byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
                int length;
                while ((length = input.read(buffer)) > 0) {
                    output.write(buffer, 0, length);
                // Finalize task.
                output.flush();
            } finally {
                // Gently close streams.
                close(output);
                close(input);
            }

  • Downloading File from server

    I have written more or less same code like following
    to send file from server to browser in other web applications, where browser displays Save As dialog box
    to the user, but the same code doesn't work with portal.
    following code part of a page flow
    <pre>
    * @jpf:action
    * @jpf:forward name="success" path="index.jsp"
    protected Forward doUploadFile()
    HttpServletResponse res = this.getResponse();
    res.setContentType("application/x-download");
    String filename="C:\\somefile.pdf";
    File file = new File(filename);
    res.setContentLength((int)file.length());
    res.setHeader("Content-Disposition", "attachment;
    filename=" +filename);
    // Send the file.
    InputStream in=null;
    OutputStream out=null;
    try
    out = res.getOutputStream( );
    in = new BufferedInputStream(
    new FileInputStream(filename));
    byte[  ] buf = new byte[4 * 1024]; // 4K buffer
    int bytesRead;
    while ((bytesRead = in.read(buf)) != -1)
    out.write(buf, 0, bytesRead);
    finally
    if (in != null) in.close();
    if (out!= null) out.close();
    return new Forward("success");
    </pre>
    following is the JSP code to trigger the action of file
    download.
    <pre>
    <netui:form action="doUploadFile">
    <netui:button type="submit" value="Upload File" />
    </netui:form>
    </pre>
    Any clue ?

    Hi,
    Im having exactly the same problem. Did you find a way to do this.
    Thanks Chris

  • Unexpected end fo file from server exception

    Hi all,
    When I try to run any of JWS demo application shipped with JRE, after a very long 'checking new version' message, the app ends up throwing the following exception :
    JNLPException[category: Download Error : Exception: java.net.SocketException: Unexpected end of file from server : LaunchDesc: null ]
         at com.sun.javaws.cache.DownloadProtocol.doDownload(Unknown Source)
         at com.sun.javaws.cache.DownloadProtocol.isLaunchFileUpdateAvailable(Unknown Source)
         at com.sun.javaws.LaunchDownload.getUpdatedLaunchDesc(Unknown Source)
         at com.sun.javaws.Launcher.downloadResources(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)What's wrong ?
    Thanks in advance
    Setya

    I am having the same problem...Seyta, did the you
    find an answer?Not yet, another thread suggested that I check my proxy setting, I already do that with no luck, actually the my proxy setting at the JWS Console is the same as in my browser.
    Would u please inform me if u find solution.
    Thanks in advance.
    Setya

  • List the files from server

    Hi Experts,
      I have a requirement in my application, that list out the files from the server in table and also delete the file. Pls specify the code.
    Regards,
    Kiruba.R

    Hi
    List all the files from server
    public void listServerFiles( )
        //@@begin listServerFiles()
        wdContext.nodeFiles().invalidate();
        IPrivateExperimentView.IFilesElement element;
        java.io.File file = new java.io.File( "D:\\Test");
        File list[] = file.listFiles();
        for( int i = 0; i < list.length; i++)
             element = wdContext.createFilesElement();
                  element.setFileName( list[ i].getName());
             wdContext.nodeFiles().addElement( element);
        //@@end
    Display the selected file
    public void onActiondownload(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActiondownload(ServerEvent)
        IWDResource resource;
        String name = wdContext.currentFilesElement().getFileName();
        String path = "D:\\Test\\" + name;
         InputStream stream;
         try {
              stream = new FileInputStream(path);
              resource = WDResourceFactory.createResource( stream, name,
                                  WDWebResourceType.UNKNOWN, true);
              stream.close();
              wdComponentAPI.getWindowManager()
                             .createNonModalExternalWindow( resource.getUrl( 0), name).show();
         } catch (FileNotFoundException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
         } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
    Delete the selected file
    public void onActiondeleteFile(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActiondeleteFile(ServerEvent)
        String path = "D:\\Test\\" + wdContext.currentFilesElement().getFileName();
        File file = new File( path);
        file.delete();
        listServerFiles();
        //@@end
    vinod

  • Delete WorkBook and Query file from Server .

    Dear All Experts .
    I dun know i posted in correct places or not .. (correct me if i m wrong) .. i want to ask about the BW Workbook and query.
    How we going to remove the remove the workbook or query files from Server ? bc i tried to delete from Analyzer(excel 2007), the file is deleted from the view , but havent delete from the server... So how i going to remove the file from server ?
    Thank.

    Hello I have the same problem. Can you please tell me how you finaly manage to delete the workbook.
    thank's you for advance,
    Akiba

  • Not able to read the wsdl file from server Premature EOF encounter

    Hi All,
    I am facing issue while accessing a web Service from server. Here is the clear view about it.
    I created a simple SyncBpel process in a composite and deployed in to the server and it is working fine. Later i created a new Asyn bpel process in a composite and in the external reference i dragged a web Service and imported the wsdl url from server of the SyncBpel and wired the Asynbpel process to webserive .
    Now here i am facing peculiar behavior which i am not able to trace it out.
    1) For the first time when i import the url of syncBpel from the server i am not facing any error and it is working fine as expected but when i close the Jdeveloper and open it i am not able to user the web Service and it is saying as "Not able to read the wsdl file from server Premature EOF encounter"
    2)When i close and open the Jdeveloper i can see the url of the wsdl which imported in webserver is changing from http://stcfmw03.satyam.com:8021/soa-infra/services/Tarak/synchronousBpel/bpelsync_client_ep?WSDL to http://stcfmw03.satyam.com:8021/soa-infra/services/Tarak/synchronousBpel/BPELsync.wsdl
    3)when I open and see the url http://stcfmw03.satyam.com:8021/soa-infra/services/Tarak/synchronousBpel/bpelsync_client_ep?WSDL I can see the soap address as *<soap:address location="http://stcfmw03.satyam.com:8021/soa-infra/services/Tarak/synchronousBpel!1.0*soa_5cfb8416-c106-40a2-a53b-9054bbe04b9c/bpelsync_client_ep"/>*
    I don’t understand why the soap end contains “*soa_5cfb8416-c106-40a2-a53b-9054bbe04b9c” and this kind of url for soap address is coming to all the bpel process which I am deploying in the server.
    I checked the in Jdeveloper where webproxy is uncheck and the server is also up but still I am facing issue of reading the error.
    Can someone please help in resolving the issue.
    I am using SOA 11g 11.1.1.5 and Jdeveloper 11.1.1.5
    Many thanks.
    Tarak
    Edited by: user11896572 on Jan 17, 2012 5:22 PM

    Hi,
    Setting default from the jdeveloper -
    During composite deployment from Jdeveloper (wizard driven), you will be given an option to choose the version of the composite and there will also be an option for you to choose if the composite needs to be deployed as default.
    Setting default from the em console -
    After deploying a composite, login to the em console and click on the composite that you want to set as default, and you will find a tab - "Set as Default". please note that this tab will not be seen, if the composite is already set as default.
    Refer -
    http://docs.oracle.com/cd/E12839_01/integration.1111/e10226/soacompapp_mang.htm
    8.2 Managing the State of Deployed SOA Composite Applications
    Thanks

  • How can i transfer more than one file from server to client

    Hi,
    our requirement is transfer more than one files from server to client using the
    webutil_file_transfer.as_to_client_with_progress.One file transfer is already working in our system.If anybody know the solution please inform
    regards
    mat

    just an idea ...
    for this purpose let us put aside security concerns and other potential problems....
    -- Get the content of a server directory with Filter and create zip file
    1) create a class that implements java.io.FilenameFilter ...
    2) define accept() method ...
    3) call File.list() with the filter as a parameter. The returned array of strings will have all the names that passed through the accept() filter
    4) use java.util.Zip to create ZIP file on the server side
    -- I think it is better to create this functionality as a separate Java class, put it in required folder and after it
    -- use Forms->Program->"Import Java class" to create pl/sql wrappers, than to create wrappers for all classes and code in pl/sql
    5) use webutil to transfer file on the client
    6) use Java on client side to unzip transferred file
    if you think this is not too complicated, you should try ...
    Regards,
    Vladimir

  • Can I use my time capsule to back up or save files from my pc?

    My time capsule works great with my 2 Macs.   I just got a PC and would like to know if I can use the time capsule to back up or save files from my PC?

    You can.. but obviously PC is missing TM.. so you will need to use a backup software.
    Saving files to the TC is not really recommended.. but as long as you have lots of space is unlikely to cause problems.. the whole idea of TM though is to keep incremental backups on an hourly basis and will slowly fill the TC.. once space is short.. it can get messy.
    Also read Pondini who is positively against using it for other files.
    http://pondini.org/TM/TCQ3.html
    I suggest you read .. skim at least the FAQ so you actually understand what TM - TC is all about.
    A USB drive plugged into the PC makes a better backup
    1. It is formatted NTFS, ie native format and readable by any windows computer. A TC is a network device.
    2. USB drives are cheap. You can use 2 of them and store one offsite.
    3. USB traffic is not on the network.
    4. Storing files on the TC is bad as it is a backup target not itself backed up.
    5. In a pc you can add drive after drive after drive.. (assuming a desktop since you didn't say laptop). Only a Mac Pro can do that in the Mac world.. internal drives are cheaper than a. USB drives, b. network drives. And they are 10x or more faster.

  • Error while reading a file from server

    Mine is 9i database and 11.5.10.2 oracle apps server
    I am trying to read PDF file from server, I used the below code
    l_bfile:=bfilename('\u05\app\applmgr\11i\oraclecomn\admin\out\jamuna_server','o7742576.out');
    if DBMS_LOB.FILEEXISTS(l_bfile) = 1 then
    dbms_output.put_line( 'Exists!');
    dbms_output.put_line(dbms_lob.getlength(l_bfile));
    else
    dbms_output.put_line( 'Not Exists!');
    end if;
    i used forward slashes (/) instead of backward slashes (\) too and i also made dbms_output.put_line(to_char(dbms_lob.getlength(l_bfile)));
    while using dbms_log package , i got the below error .I am bit worried since I have created directory and gave sufficicent priviliges too.
    Error report:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01460: unimplemented or unreasonable conversion requested
    ORA-06512: at "SYS.DBMS_LOB", line 485
    ORA-06512: at line 24
    I am sure bfilename('\u05\app\applmgr\11i\oraclecomn\admin\out\jamuna_server','o7742576.out') is give BFILE which is empty.
    Can you please suggest me what I can do to move further? what kind of priviliges it requires to point and read the file from server?
    Please help me in this.
    Thanks in advance

    I suspect you are not using a directory object is the problem.
    Here is the formal description of bfilename
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/functions12a.htm#SQLRF00610
    Sybrand Bakker
    Senior Oracle DBA

  • Reading a XML File from server in BI Publisher

    Hi All,
    Can any one help me how i can get the XML file from server to BI Publisher using data source.
    The file should transfer directly to BI Publisher with out storing it in any local directory in local system.
    Thank you
    Shalini.

    Shalini
    Do you mean that you have another system that is going to serve up the XML data and you want BIP to be able to pick it up as a data source ?
    Couple of options:
    1, If the XML filename can remain static you can use the 'XML File' datasource. You need to set up a directory on the server and then maybe create a dummy XML file to start with upon which you can build a report. Then have your external data generator put the file into that directory and then schedule the report so that BIP will pick and report.
    2. IS the data generator accessible via HTTP or web service - BIP supports those too.
    3. More complex but with a little effort you can create a servlet that will pick up the file from a directory and serve it up to BIP on demand - Im going to write about this on the blog this week
    Regards
    Tim

  • Error while starting the server - Unexpected end of file from server|

    Hi,
    I am getting below error when I start my glassfish server.
    SEVERE|sun-appserver2.1|com.stc.emanager.deployment.sunone.model.runtime.ServerRuntimeModel|_ThreadID=86;_ThreadName=httpWorkerThread-4048-3;_RequestID=8d1f2acd-9e4e-4e9f-a9fd-3b21e4223318;|Unexpected end of file from server|#]
    I see the process is running. But, I am not able to open admin console.
    could any one plz help me to resolve this issue.
    Thanks in Advance,
    -Manandi

    Welcome to the forum.
    Unfortunately for you, posting only about things not working isn't going to net you assistance or answers - at most you can get sympathy but there isn't too much of that to share with everyone. You should find a forum for the particular product that is not working. If you have a problem with Glassfish, then try the Glassfish forum.
    http://www.java.net/forums/glassfish/glassfish

Maybe you are looking for

  • How can I click on a photo to enlarge it in a separate box?

    How can I click on a photo on my webpage and show an enlarged photo of it?  Everything I read points to "thumbnails" under "slideshows".  I do not need a slideshow, just an enlargement with a text box.  Help.

  • Error in Kpro server when checking in originals from NW Portal

    Hi Experts, I am not able to check in originals in my NetWeaver Portal. When I try to save I get the follwoing error message: - Error in Kpro server But if I try in to check in the same original in the PLM system through SAP GUI it works just fine. A

  • Aggiornamento ios 6.1 con Iphone 4! Aiuto!

    Salve ragazzi ho appena aggiornato il mio a iphone 4 da ios 5.0.1 ad ios 6.1, prima dell'aggiornamento andava tutto bene con il nuovo ios 6.1 non funziona ne wifi nel senso che si connette ma non naviga, e non aggancia la rete 3g! Ho fatto già un rip

  • PO Information is grad out for some of the employees in the assignment

    Hi All, I am facing an issue in the People--> Assignment--> "Purchase Order Information" tab. For some of the employees the accounting flexfield is updatable but for some of the employees it's graded out. Kindly provide route cause for this. Thanks a

  • Iphoto and Nikon D7200 RAW (NEF)

    Hello all, I just bought the new Nikon D7200. I shot some photo's and wanted to download them into Iphoto. Iphoto does not recocnize the NEF (RAW) files. Is this because the camera is too new? and isn't supported yet? If so does anyone know when an u