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

Similar Messages

  • How to copy file from server to another machine in network through JSP

    Hello!
    any body can solve my problem.
    i m working in JSP. i want to copy a file from server on which JSP engine is running to another computer in the same network.
    i used Java File Object to copy file from one machine to another in network. and its working fine on network. but the problem is when i used the same code in web page there is exception which is Access is Denied. what i should do now.
    i m writing the code i m using in my JSP page
    String fileToCopy = "C:/oracle/Apache/Apache/htdocs/FAO/FAO_MiddleFrame.jsp";
         String destinationDir = "\\\\af09\\c";
    File source = new File(fileToCopy);
    String fileName1 = source.getName();
    if ((!destinationDir.endsWith("\\")) && (!destinationDir.endsWith("/"))) {
    destinationDir = destinationDir + "\\";
    File destination = new File(destinationDir + fileName1);
    if (!destination.exists()) {
    if (!destination.createNewFile()) {
    //throw new IOException("Unable to create file. May be you don't have permissions.");
    byte[] buffer = new byte[1024];
    FileInputStream in = new FileInputStream(source);
    FileOutputStream outStream = new FileOutputStream(destination);
    int bytesRead = 0;
    while ((bytesRead = in.read(buffer)) != -1) {
    outStream.write(buffer, 0, bytesRead);
    out.println("File copied successfully ....");
    plz reply me as soon as possible.
    i will be very thankful
    Saad

    Thats the way it works. Cause servlet contaner doesnot allow other machines in the network to access other than machine which it came from as in case of applets. What you can do is if the other machine is also based on webserver or app server .. you can upload the file as it gets to that page do the process.
    I would like to hear more on my comments..
    Suggestions ??
    Ban

  • How to download file from server to client's local ??

    How to download a file from the server to the client's local machine in a particular folder without users intervention ie. 'Save As" prompt of the browser should be avoided and if the client clicks on "Download" button, the file should get automaticaly downloaded to say, "c:/reports/' on his/her local machine. This is for Java based web appliaction.

    http://jguru.com/faq/view.jsp?EID=10646

  • How to transfer file from server to client

    I am making a server printer where all the system can take print out from the Printer installed on the server
    i am not able to send file from the client to the Server. I am Attaching the code Please Help me it is my college project.
    Server.java*
    import java.io.*;
    import java.lang.*;
    import java.net.*;
    import java.util.*;
    import java.io.File;
    class Server
         static final int PORT     = 26548; //Server Listening port
         static String path;
         public static void main(String args[])
              System.out.println("Starting Server");
              receive();
         public static void receive()
              while ( true )
                   try
                        //Create a socket
                        ServerSocket srvr = new ServerSocket(PORT);
                        Socket skt = srvr.accept();
                        String clientname= skt.getInetAddress().getHostAddress();
                        int clientport=skt.getPort();
                        long time = System.currentTimeMillis();
                        path= "C:\\Ankit Gupta\\Programs\\"+clientname+"\\"+time+" test.pdf";
                        System.out.println("File Recieved from : "+clientname+" : "+clientport);
                        //HttpServletRequest req;
                        //String remoteHost = req.getRemoteHost();
                        //String adr = getRemoteUser();
                        FileOutputStream fos = new FileOutputStream(path);
                        BufferedOutputStream out = new BufferedOutputStream(fos);
                        BufferedInputStream in = new BufferedInputStream( skt.getInputStream() );
                        //Read, and write the file to the socket
                        int i;
                        System.out.println("Receiving data...");
                        while ((i = in.read()) != -1)
                             out.write(i);
                        out.flush();
                        in.close();
                        out.close();
                        skt.close();
                        srvr.close();
                        System.out.println("Transfer complete.");
                        printfile();
                   catch(Exception e)
                        System.out.print("Error! It didn't work! " + e + "\n");
                   try
                        Thread.sleep(1000);
                   catch (InterruptedException ie)
                        System.err.println("Interrupted");
              } //end infinite while loop
         public static void printfile()
              delete();
         public static void delete()
              try
                   Thread.sleep(5000);
              catch (InterruptedException ie)
                   System.err.println("Interrupted");
              System.out.println("Deleting file");
              File f = new File(path);
         // Make sure the file or directory exists and isn't write protected
              if (!f.exists())
                   throw new IllegalArgumentException("Delete: no such file or directory: " + path);
         if (!f.canWrite())
                   throw new IllegalArgumentException("Delete: write protected: "+ path);
              // If it is a directory, make sure it is empty
         if (f.isDirectory())
                   String[] files = f.list();
                   if (files.length > 0)
                   throw new IllegalArgumentException("Delete: directory not empty: " + path);
         // Attempt to delete it
              boolean success = f.delete();
              if (!success)
                   throw new IllegalArgumentException("Delete: deletion failed");
    Client.java_
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    import java.util.*;
    import java.net.*;
    public class Client extends JFrame {
    static final int PORT = 26548; //Server Listening Port
    static File file;
    static final String HOST = "10.35.9.152";//Server Address     
    JTextField m_fileNameTF = new JTextField(25);
    JFileChooser m_fileChooser = new JFileChooser();
    Client() {
    m_fileNameTF.setEditable(false);
         JButton openButton = new JButton("Open");
         openButton.addActionListener(new OpenAction());
         JPanel content = new JPanel();
         content.setLayout(new FlowLayout());
         content.add(openButton);
    content.add(m_fileNameTF);
         this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         this.setContentPane(content);
         this.setSize(400,200);
    class OpenAction implements ActionListener {
         public void actionPerformed(ActionEvent ae) {
              int retval = m_fileChooser.showOpenDialog(Client.this);
              if (retval == JFileChooser.APPROVE_OPTION) {
                   file = m_fileChooser.getSelectedFile();
              m_fileNameTF.setText(file.getAbsolutePath());
                   send(file.getAbsolutePath());
    public static void main(String[] args) {
         JFrame window = new Client();
         window.setVisible(true);
         public static boolean send( String filename )
         try
              System.out.println("Connecting to Server");
              Socket skt = new Socket(HOST, PORT);
              //Create a file input stream and a buffered input stream.
              FileInputStream fis = new FileInputStream(filename);
              BufferedInputStream in = new BufferedInputStream(fis);
              BufferedOutputStream out = new BufferedOutputStream( skt.getOutputStream() );
              //Read, and write the file to the socket
              int i;
              System.out.println("Connected to Server");
              System.out.println("Sending data...\n");
              while ((i = in.read()) != -1)
                   out.write(i);
                   //System.out.println(i);
              System.out.println("Transfer complete.");
              //Close the socket and the file
              out.flush();
              out.close();
              in.close();
              skt.close();
              return true;
         catch( Exception e )
                   send(file.getAbsolutePath());
              return false;
    }

    I am making a server printer where all the system can take print out from the Printer installed on the server
    i am not able to send file from the client to the Server. I am Attaching the code Please Help me it is my college project.
    Server.java*
    import java.io.*;
    import java.lang.*;
    import java.net.*;
    import java.util.*;
    import java.io.File;
    class Server
         static final int PORT      = 26548; //Server Listening port
         static String path;
         public static void main(String args[])
              System.out.println("Starting Server");
              receive();
         public static void receive()
              while ( true )
                   try
                        //Create a socket
                        ServerSocket srvr = new ServerSocket(PORT);
                        Socket skt = srvr.accept();
                        String clientname= skt.getInetAddress().getHostAddress();
                        int clientport=skt.getPort();
                        long time = System.currentTimeMillis();
                        path= "C:\\Ankit Gupta\\Programs\\"+clientname+"\\"+time+" test.pdf";
                        System.out.println("File Recieved from : "+clientname+" : "+clientport);
                        //HttpServletRequest req;
                        //String remoteHost = req.getRemoteHost();
                        //String adr = getRemoteUser();
                        FileOutputStream fos = new FileOutputStream(path);
                        BufferedOutputStream out = new BufferedOutputStream(fos);
                        BufferedInputStream in = new BufferedInputStream( skt.getInputStream() );
                        //Read, and write the file to the socket
                        int i;
                        System.out.println("Receiving data...");
                        while ((i = in.read()) != -1)
                             out.write(i);
                        out.flush();
                        in.close();
                        out.close();
                        skt.close();
                        srvr.close();
                        System.out.println("Transfer complete.");
                        printfile();
                   catch(Exception e)
                        System.out.print("Error! It didn't work! " + e + "\n");
                   try
                        Thread.sleep(1000);
                   catch (InterruptedException ie)
                        System.err.println("Interrupted");
              } //end infinite while loop
         public static void printfile()
              delete();
         public static void delete()
              try
                   Thread.sleep(5000);
              catch (InterruptedException ie)
                   System.err.println("Interrupted");
              System.out.println("Deleting file");
              File f = new File(path);
             // Make sure the file or directory exists and isn't write protected
              if (!f.exists())
                   throw new IllegalArgumentException("Delete: no such file or directory: " + path);
             if (!f.canWrite())
                   throw new IllegalArgumentException("Delete: write protected: "+ path);
              // If it is a directory, make sure it is empty
             if (f.isDirectory())
                   String[] files = f.list();
                   if (files.length > 0)
                   throw new IllegalArgumentException("Delete: directory not empty: " + path);
             // Attempt to delete it
              boolean success = f.delete();
              if (!success)
                   throw new IllegalArgumentException("Delete: deletion failed");
    Client.java_
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    import java.util.*;
    import java.net.*;
    public class Client extends JFrame {
    static final int PORT = 26548; //Server Listening Port
    static File file;
    static final String HOST = "10.35.9.152";//Server Address     
    JTextField   m_fileNameTF  = new JTextField(25);
    JFileChooser m_fileChooser = new JFileChooser();
    Client() {
       m_fileNameTF.setEditable(false);
         JButton openButton = new JButton("Open");
         openButton.addActionListener(new OpenAction());
         JPanel content = new JPanel();
         content.setLayout(new FlowLayout());
         content.add(openButton);
      content.add(m_fileNameTF);
         this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         this.setContentPane(content);
         this.setSize(400,200);
    class OpenAction implements ActionListener {
         public void actionPerformed(ActionEvent ae) {
              int retval = m_fileChooser.showOpenDialog(Client.this);
              if (retval == JFileChooser.APPROVE_OPTION) {
                   file = m_fileChooser.getSelectedFile();
                 m_fileNameTF.setText(file.getAbsolutePath());
                   send(file.getAbsolutePath());
    public static void main(String[] args) {
         JFrame window = new Client();
         window.setVisible(true);
         public static boolean send( String filename )
         try
              System.out.println("Connecting to Server");
              Socket skt = new Socket(HOST, PORT);
              //Create a file input stream and a buffered input stream.
              FileInputStream fis = new FileInputStream(filename);
              BufferedInputStream in = new BufferedInputStream(fis);
              BufferedOutputStream out = new BufferedOutputStream( skt.getOutputStream() );
              //Read, and write the file to the socket
              int i;
              System.out.println("Connected to Server");
              System.out.println("Sending data...\n");
              while ((i = in.read()) != -1)
                   out.write(i);
                   //System.out.println(i);
              System.out.println("Transfer complete.");
              //Close the socket and the file
              out.flush();
              out.close();
              in.close();
              skt.close();
              return true;
         catch( Exception e )
                   send(file.getAbsolutePath());
              return false;
    }

  • How to transfer file from server to client pc with out client unknown

    Hi,
    Fill some form ,then submit, that time generate one xml file put in server,then the same file transfer to client machine fixed path(c:/download/) with out any pop up message..
    Pls help ..
    pls give some code idea
    Thanks in Advance
    karthik

    Thanks
    Vendor application only call the URL with parameter
    to get the File in secured manner. OK.
    the Vendor
    application may be in java or not..NET ?
    so in that case
    also do.so what ? is your problem solved or not ?
    you may need to make webservices.

  • 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

  • Move files from server to client

    I have create txt file in server directory using UTL_FILE package,
    and I put in the directory in server.
    Server platform is linux. and client platform in Windows.
    What I want to ask is there any possibilities to copy that file from server to client using pl/sql ? could all of you "The Gurus" give me a script example ?
    Thanks a lot.
    regards,
    indra

    > What I want to ask is there any possibilities to copy that file from server
    to client using pl/sql
    No. Not really.
    Think about it.. the file is on the server. PL/SQL code executes inside the Oracle server session that is servicing the client.
    Just how is PL/SQL (on the server) suppose to reach out and push that file to a client's file system and directory?
    PL/SQL cannot do this. You need something on the client that will accept the file. You need something in-between the client and PL/SQL that will handle the transfer of the file. This something can be ftp, scp, tftp, NetBIOS etc.
    Anyway you look at this, it does not make sense. You are turning the server into the client that needs to push the file. You are turning the client into a server that needs to accept the file.
    Why? This is contrary to the basic client-server RDBMS architecture. You are adding more complexities and more moving parts to the architecture by forcing a swap of client and server roles. The are now a far greater likelihood of errors and bugs and failures.
    It does not make sense to do it this way.
    What is the business requirement you are trying to satisfy? Instead of us trying to help you to hack a flawed solution, let us rather assist you in determining the correct and proper solution.

  • How to get file from server while click on link

    Hi,
    i created on link and i gave one server path to select file from server but while clickinng on link it no displaying any thing.
    following is the Destination url that i gave for the item.
    /u08/app/appvis/xxex/inst/xxex_apps/xxrbe/logs/appl/conc/log/
    please tell me how to get file from server while click on link.

    Ok I got your requirement now.
    If you are getting file names from view attribute then you should not be adding destination URI property for the link.
    Instead you can use OADataBoundValueViewObject API.
    Try below code in your controller processRequest method:
    I am assuming that you are using classic table.
    Also in below example it considers OAMessageStyleText and you can replace it with link item if you want.
    OATableBean tableBean =
    (OATableBean)webBean.findChildRecursive("<table item id>");
    OAMessageStyledTextBean m= (OAMessageStyledTextBean)tableBean.findChildRecursive("<message styled text in table item id>");
    OADataBoundValueViewObject tip1 = new OADataBoundValueViewObject(m, "/u08/app/appvis/xxex/inst/xxex_apps/xxrbe/logs/appl/conc/log/"+"<vo attr name which stores file name for each row>");
    m.setAttributeValue(oracle.cabo.ui.UIConstants.DESTINATION_ATTR, tip1);
    Regards,
    Sandeep M.

  • How to tranfer file from between two client?

    Hi, all:
    I'd like to tranfer file from client A to client B. Basically, I will treat one of them is client and one of them is server, then create a server socket/socket connection, then they can conmmunicate. I know how to talk between them. However, I don't know how to trasfer file from client to server, or from server to client in the same class. I mean not two class: Server socket and client socket.
    Consider the following case:
    There is a function, just like MSN file transfer: transfer file from localhost to "10.4.155.8". How can I transfer file from localhost to "10.4.155.8"?
    Help please.
    --Paul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hi, man:
    Thanks.
    I agree with you at most.
    I am doing my practise project: the other MSN Messenger and more, I will include file encryption and file decryption, etc.
    My point is one connection will make center server too heavy. Then I have to adapt your first means:
    promote either Client A or Client B become server, leave the other guy still being client, because I know their IP address. This will free the server a lot.
    BTW, I finish my code pretty much, say 70%. However, I felt tired for coding. I have my full time job in software development at daytime. I am looking one or two guy to share this project. My point is to improve the performance of the this Messenger. I feel my code maybe work fine with hundred of con-current user, maybe not, or maybe more, not sure. My email: [email protected]. (I put my name means I am searious).
    Could anyone feel he/she is good at Messenger, please email me, then we can share my code with you.
    Code sample for file transfer:
    //For Client side
    import java.io.*;
    import java.net.*;
    class Client
    public static void main(String args[]) throws Exception
    String sentence;
    String host = "localhost";
    int SERVER_LISTEN_PORT = 5432;
    BufferedReader inFromUser = new BufferedReader(new InputStreamReader(System.in));
    Socket clientSocket = null;
    DataOutputStream outToServer = null;
    BufferedInputStream inFromServer = null;
    try
    clientSocket = new Socket(host, SERVER_LISTEN_PORT);
    outToServer = new DataOutputStream(clientSocket.getOutputStream());
    inFromServer = new BufferedInputStream(clientSocket.getInputStream());
    }catch(UnknownHostException e)
    System.err.println("Don't know about host: "+host);
    }catch(IOException e)
    System.err.println("Couldn't get I/O for the connection to: "+host);
    sentence = inFromUser.readLine();
    outToServer.writeBytes(sentence + '\n');
    FileOutputStream fos = new FileOutputStream("c://test.doc");
    int totalDataRead;
    int totalSizeWritten = 0;
    int DATA_SIZE = 20480;
    byte[] inData = new byte[DATA_SIZE];
    System.out.println("Begin");
    while ((totalDataRead = inFromServer.read(inData, 0, inData.length)) >= 0)
    fos.write(inData, 0, totalDataRead);
    totalSizeWritten = totalSizeWritten + totalDataRead;
    System.out.println(totalSizeWritten);
    System.out.println("Done");
    fos.close();
    clientSocket.close();
    //For Client side
    import java.io.*;
    import java.net.*;
    class Server
    public static void main(String args[]) throws Exception
    int SERVER_LISTEN_PORT = 5432;
    String clientSentence;
    ServerSocket welcomeSocket = null;
    try
    welcomeSocket = new ServerSocket(SERVER_LISTEN_PORT);
    }catch(IOException ioe)
    System.out.println("Could not listen on port: " + SERVER_LISTEN_PORT);
    System.exit(1);
    while(true)
    Socket connectionSocket = null;
    try
    connectionSocket = welcomeSocket.accept();
    }catch(IOException ioe)
    System.err.println("Accept failed.");
    System.exit(1);
    BufferedReader inFromClient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()));
    BufferedOutputStream outToClient = new BufferedOutputStream(connectionSocket.getOutputStream());
    System.out.println(inFromClient.readLine());
    int data;
    int totalSizeTransferred = 0;
    int totalSizeRead;
    int PACKET_SIZE = 20480;
    byte[] packet = new byte[PACKET_SIZE];
    System.out.println("reading file...");
    FileInputStream fis = new FileInputStream("c://JVM_Profiling_Report.doc");
    while ((totalSizeRead = fis.read(packet, 0, packet.length)) >= 0)
    outToClient.write(packet, 0, totalSizeRead);
    totalSizeTransferred = totalSizeTransferred + totalSizeRead;
    System.out.println(totalSizeTransferred);
    System.out.println("done reading file...");
    outToClient.close();
    fis.close();
    My question, any good idea for creating progress bar?
    Thanks.

  • How to read file from server if I have a logical file path?

    Hi guys,
    I'm having a pretty "on the run" question,
    My program is currently reading a file from server using "open dataset" with file path like this (just example)
    /usr/interface/abc/bcd/testfile.dat
    Now I got a requirement to make it more consistent to read files, instead of reading that physical file name, I should read the files from a specific folder using logical path.
    So I go to T code "FILE" and created a logical path called ZABC_FILE_PATH, unix compatible, with physical path is (for example),
    /usr/interface/<sysid>/<client>/<filename>
    My question is, can I still use open dataset statement to read this? if yes, how do I do that? If no, there should be alternative way, please let me know what you think. Thanks,

    Thanks all, I figured it out.
    ONe thing is that typo double quote
    The other thing is the importing part, I need the full file path.
    CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
      EXPORTING
        CLIENT                           = SY-MANDT
        logical_path                     = 'ZABC_MY_LOGICAL_FILE_PATH'
    *   OPERATING_SYSTEM                 = SY-OPSYS
    *   PARAMETER_1                      = ' '
    *   PARAMETER_2                      = ' '
    *   PARAMETER_3                      = ' '
    *   USE_BUFFER                       = ' '
        file_name                        =  v_1
    *   USE_PRESENTATION_SERVER          = ' '
    *   ELEMINATE_BLANKS                 = 'X'
      IMPORTING
        FILE_NAME_WITH_PATH              = v_what_I_need
    * EXCEPTIONS
    *   PATH_NOT_FOUND                   = 1
    *   MISSING_PARAMETER                = 2
    *   OPERATING_SYSTEM_NOT_FOUND       = 3
    *   FILE_SYSTEM_NOT_FOUND            = 4
    *   OTHERS                           = 5
    I really appreciate your contributions, thanks again!

  • How to read file from server

    Hi,
    When i try to read file from server,the following message is displayed .
    ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: the Permission (java.io.FilePermission /tmp read) has not been granted to EWMTRACKTEST. The PL/SQL to grant this is dbms_java.grant_permission( 'EWMTRACKTEST', 'SYS:java.io.FilePermission', ' /tmp', 'read' )
    ORA-06512: at "EWMTRACKTEST.GET_DIRLIST_EWM", line 1
    ORA-06512: at line 1
    thanks and regards
    P Prakash

    it seems obvious, user EWMTRACKTEST doesn`t have access to directory /tmp and the file under that.
    try to give read permission and try again.
    you could use command line like 'chmod' to grant permissions.

  • How to export XML from server to local machine

    Hi all
    i want to export some XML files from instance to my local machine.right now i m i have Ftpied the files from server to to my local machine but ,but it is not coming with personalization .
    thanx in advance
    Pratap

    Hi Paratap,
    If you want to see source of the page use
    call jdr_utils.printDocument('/oracle/apps/pos/orders/webui/PosVpoMainPG');
    If you want to see the personalization for the source use
    call jdr_utils.printDocument('/oracle/apps/pos/orders/webui/customizations/site/0/PosVpoMainPG');
    I have given these examples for site level personalization, depanding upon the personalization level the path may vary.
    You can also export the files using XMLExporter by giving appropriate path.
    You can FTP all other source files from the server.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • 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.

  • Help :- Send Large File From Server To Client

    Hey guys, I am stuck with a problem.Hope u guys might be able to help me out. My problem is :-
    From client i am doing an operation which results in calculation of results by server and saving a file on the server..But i want to see what results have been computed by the server and hence i want to stream that file back to the client..
    The file may be of 100MB as well , that is, the size of the file may be huge.
    I want u guys to tell me how to stream that file back to the client..I tried returning byte array which gets serialized and then received at client side but as i said the file may be huge so memory problem may arise, so returning byte[] from function is not a good solution..
    I am looking something where server can send the file back to the client in chunks..Client keeps receiving these chucks and keep putting them in the file.
    So how to make server send file in chunks??Also, i don't know the hostname and ports...so sockets i can't use...
    Any Another way to do it...??
    is PipedStream a solution??
    Please guys, help me
    Thanks in advance
    Edited by: 854509 on Apr 25, 2011 8:28 AM
    Edited by: 854509 on Apr 25, 2011 8:59 AM

    854509 wrote:
    I knew about sockets but as i said i am able to send request to server by client by calling a remote method...There i haven't used sockets...RMI uses sockets, I assume you mean you don't access to the underlying socket.
    So i wanted to know if we can without using sockets send file back to Client..I would have the RMI return the connection details where the result can be obtains, .e.g with hostname, port, and file name to use.
    I would suggest trying to compress the stream as well (just wrapp the stream on the sender/reciever), especially for files over 1 MB.
    Tell me something abt PipedStreams as well..If they are of any use here or not?I don't see how. PipedStreams can be used to share data between threads in the same process.
    If RMI is your only choice you can perform a method which would return alot of data and have seperate methods to download portions of it.
    e.g.
    public int loadBigFile(String filename); // returns the number of portions.
    public byte[] returnPortion(int n);
    int portions = rmi.loadBigFile("my-big-file.xml");
    for(int i=0;i<portions;i++) {
       byte[] bytes = rmi.returnPortion(i);
       // do something with bytes.
    }You can have the server cleanup the file when the last portion is read.

  • Drive Redirection virtual channel hangs when copying a file from server to client over RDP 8.1

    Problem Summary:
    A UTF-8 without BOM Web RoE XML file output from a line of business application will not drag and drop copy nor copy/paste from a Server 2012 R2 RD Session Host running RD Gateway to a Windows 7 Remote Desktop client over an RDP 8.1 connection and the Drive
    Redirection virtual channel hangs.  The same issue affects a test client/server with only Remote Desktop enabled on the server.
    Other files copy with no issue.  See below for more info.
    Environment:
    Server 2012 R2 Standard v6.3.9600 Build 9600
    the production server runs RDS Session Host and RD Gateway roles (on the same server).  BUT,
    the issue can be reproduced on a test machine running this OS with simply Remote Desktop enabled for Remote Administration
    Windows 7 Pro w SP1v6.1.7601 SP1 Build 7601 running updates to support RDP 8.1
    More Information:
    -the file is a UTF-8 w/o BOM (Byte Order Marker) file containing XML data and has a .BLK extension.  It is a Web Record of Employment (RoE) data file exported from the Maestro accounting application.
    -the XML file that does not copy does successfully validate against CRA's validation XML Schema for Web RoE files
    -Video redirection is NOT AFFECTED and continues to work
    -the Drive Redirection virtual channel can be re-established by disconnecting/reconnecting
    -when the copy fails, a file is created on the client and is a similar size to the original.  However, the contents are incomplete.  The file appears blank but CTRL-A shows whitespace
    -we can copy the contents into a file created with Notepad and then that file, which used to copy, will then NOT copy
    -the issue affects another Server 2012 R2 test installation, not just the production server
    -it also affects other client Win7 Pro systems against affected server
    -the issue is uni-directional i.e. copy fails server to client but succeeds client to server
    -I don't notice any event log entries at the time I attempt to copy the file.
    What DOES WORK
    -downgrading to RDP 7.1 on the client WORKS
    -modifying the file > 2 characters -- either changing existing characters or adding characters (CRLFs) WORKS
    -compressing the file WORKS e.g. to a ZIP file
    -copying OTHER files of smaller, same, and larger sizes WORKS
    What DOES NOT WORK?
    -changing the name and/or extension does not work
    -copying and pasting affected content into a text file that used to have different content and did copy before, then does not work
    -Disabling SMB3 and SMB2 does not work
    -modifying TCP auto-tuning does not work
    -disabling WinFW on both client and server does not work
    As noted above, if I modify the affected file to sanitize it's contents, it will work, so it's not much help.  I'm going to try to get a sample file exported that I can upload since I can't give you the original.
    Your help is greatly appreciated!
    Thanks.
    Kevin

    Hi Dharmesh,
    Thanks for your reply!
    The issue does seem to affect multiple users.  I'm not fully clear on whether it's multiple users and the same employee's file, but I suspect so.
    The issue happens with a specific XML file and I've since determined that it seems to affect the exported RoE XML file for one employee (record?) in the software.  Other employees appear to work.
    The biggest issue is that there's limited support from the vendor in this scenario.  Their app is supported on 2012 R2 RDS.
    What I can't quite wrap my head around are
    why does it work in RDP 7.1 but not 8.1?  What differences between the two for drive redirection would have it work in 7.1 and not 8.1?
    when I examine the affected file, it really doesn't appear any different than one that works.  I used Notepad++ and it shows the encoding as the same and there doesn't appear to be any invalid characters in the affected file.  I wondered
    if there was some string of characters that was being misinterpreted by RDP or some other operation and blocked somehow but besides having disabled AV and firewall software on both ends, I'm not sure what else I could change to test that further
    Since it seems to affect only the one employee's XML file AND since modifying that file to change details in order to post it online would then make that file able to be copied, it seems I won't be able to post a sample.  Too bad.
    Kevin

Maybe you are looking for

  • "access to keychain forbidden" while adding CalDav account

    My problems started when a client's mobile account became disabled after the open directory locked them out.  I was able to "unlock" the account by deleting the a keychain (somehow, I am not so good documenting while under pressure).  Unfortunately,

  • Error in OBN configuration Transport in SAP HR Portal

    Dear All We have configured flexible performance management in SAP ECC 6.04 with new webdynpro interface.The issue is that OBN settings which are required to be done are not getting transported from dev to quality.Also i do not see any way to copy th

  • Date range validation

    I have a requirement where i have to check date range in select option and if its more than 45days the I have to give an Informatory message and exit the programme , How can I do that ?? Urgent Plzz..

  • Airplay icon missing in itunes windows solution

    I have had trouble with itunes having the airplay icon show up. I use the remote app on ipad and was having trouble with it finding my iTunes library. I could play content on apple tv and stream from ipad to TV but the issue with the remote app not w

  • Mavericks,  Reminders and icloud

    Since loading Mavericks,  reminders on my iMac won't sync with icloud although my iphone does .    Contacts sync fine though .....any ideas , guys ?