Getting a csv file in server from client

Hi,
This is my first mail to the forum. I hope some one would help me to find a solution for me. I got a xyz . csv file in my server. I want to get that file and save it in my client (anywhere)having the same file type. Gimme source code if you have. I am looking for a solution for the past two days.
please reply me as soon as possible.
To be more clear, I am having a save button in my page.On clicking this button i should fetch the file from server and save it in my desired location as a file itself not as text content or anything.
Please help me
Thanks in regards,
S.karthik

You can open the textfile on the servlet and then send the information to the client (applet) as stirngs. The must then applet convert the stirngs into some object or simply display the information in someway. But then the text file that you are opening must be stored in some relevant tomcat directory e.g. on the server. If you want to open a file on the clients computer, you get into signed applets.

Similar Messages

  • Creation of files on server from client

    i want to create a file on server from client.
    so i have to create the file using uri that resides on server, but i am not able to create file using that URI
    i want to create in this location.
    "http://localhost:8080/web/a.jsp"
    so please give me the syntax for that.
    thanks in advance

    i checked that url........but its talking ablut urlconnection and url......but i want to create file with uri....could u plz help me
    thx & regds

  • Cannot acess file on server from client machine using java web start

    Hi everyone,
    I am creating an appication using JWS and Apache Web Server version 2.0.54 on Linux. I am trying to access a file on the server that IS NOT inside the jar file. I have given full access (r, w, x) to all users on my server. We also created a FilePermission object and gave the file read and write access as well. But when we deploy the program and try to get this file, a SecurityException is thrown with the following mesage:
    acess denied (java.io.FilePermission filename read) where filename is the file in our local filesystem. Any suggestions on what I can do?
    Any help would be greatly appreciated.
    Thanks,
    Raj

    It sounds like you are trying to access the file as if your JNLP application were running on the server. The JNLP app is running on the client machine, so you will need to use a URL to open the file. Take a look at the JavaDocs for the following:
         java.net.URL
         java.net.URI
         java.net.File
    You also need to be sure your server is configured to serve the file. For example, you ought to be able to access the file through your browser using something like http://www.myco.com/myapp/myfile.txt. (How you configure your server is a topic for a different forum.)
    You probably also want to look into JavaWS security, and even Java security in general to determine if you need to sign your app or not. Here are some links to get you started:
            http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/development.html#security
            http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/security.html
            http://java.sun.com/sfaq/
            http://java.sun.com/j2se/1.5.0/docs/guide/security/permissions.html
            http://java.sun.com/j2se/1.5.0/docs/guide/security/index.html
    Mike.

  • Code for uploading a file to server from client

    please help me as soon as possible

    The Apache > Jakarta > Commons FileUpload package makes it easy to add robust, high-performance, file upload capability to your servlets and web applications.

  • Create a new file on server from an applet

    Hello!
    I 'm trying to create a text file on server from an applet, i have permissions to write on server and i'm running in apache, my code is
    public void write () {
    try{
    URL url = new URL("http://localhost/bnm/hello.txt");
    URLConnection urlcon = url.openConnection();
    urlcon.setDoOutput(true);
    urlcon.setUseCaches(true);
    PrintWriter pt = new PrintWriter
    (new OutputStreamWriter (urlcon.getOutputStream()));
    String str = new String(URLEncoder.encode("this is output applet ")) ;
    pt.print(str);
    pt.flush();
    catch(Exception e)
    e.printStackTrace();
    The result is nothing, the file isn�t created, but the code don't throw exceptions.
    Ah! in other example, i can read a file of server fro m the applet, the problem is to write
    Anybody, knows the matter??
    Excuse my poor english :P
    Thanks for all.

    I had the same needs and didn't know whether this was possible, due to applets security restriction. So I searched the Web and found some contradictory information. I will explain what I think is the situation, to give you an answer, but also so that other people can tell me whether I understood correctly.
    1) Unless you sign it, an applet cannot write files directly, either client-side or server-side. All what it can do to access a file server-side (except .jar files ?) is opening a http connection, which allows only to retrieve data. When I try to run code such as yours, I get this exception :
    java.net.UnknownServiceException: protocol doesn't support output
         at java.net.URLConnection.getOutputStream(URLConnection.java:679)
    2) As Ares_Man points out, what it can do is opening a http connection not directly with the file you want, but with a server-side script (JSP, PHP, CGI,...) which will be allowed to write files on the server. You can use POST or GET parameters to pass to the script what you are going to write.
    This simple code worked for me (it executed the script toto.php):
              try{
                   URL toto=new URL(getCodeBase(),"toto.php");
                   InputStream f=toto.openStream();
                   f.close();
              catch(Exception e){
                   e.printStackTrace();
    Probably it's a good idea to do a URLConnection.setCache(false) though, to be sure that the script toto.php will be executed.
    3) I don't know how you can pass serialized objects as parameters. So if more than text informations are to be written, I would tend to make the script store them into a database instead of files. That way, you could pass any SQL query as parameter, maybe along with a password parameter for security. I don't know whether this is secure enough.

  • Write to file on server from app

    Am trying to write to a file on server from an application like this:
    java.net.URL url = new java.net.URL("http://www.rikif.dk/test.txt");
    URLConnection conn = url.openConnection();
    conn.setUseCaches(false);
    conn.setDoOutput(true);
    PrintStream out =
    new PrintStream(conn.getOutputStream());
    out.print("sdfsdf");
    out.flush();
    out.close();
    But nothing happens. What am I doing wrong?

    No exceptions.. "Unlike other output streams, a PrintStream never throws an IOException".
    You can write a file through HTTP into a web server? It does not make sense really.. is the file writable in the web server?
    And why be writable - anyone would be able to write it then.
    You can achieve that through sockets. A java program on the remote machine (playing the role of a server) would accept data through a socket from the clients, and would write the files itself.. without need of web servers.
    You can use a tomcat server, and use a servlet, again to accept data and write the files itself.
    ..or?

  • Uploading File to server from local machine

    how to Upload the File to server from local machine.
    Using java applet, how to upload the file to secure server.
    I dont know how to proceed the steps for uploading
    Reply me ASAP.......

    Hi Ozkantr,
    The osql utility is installed by SQL Server. You need to make sure the utility is installed on your colleague machine.
    To run SSIS package outside the BIDS, only the DTExec utility which is a client tool is not enough, the server components for Integration Services Service (SSIS runtime) is also required. To install SSIS runtime and DTExec utility, we must install the Integration
    Services shared feature from the SQL Server install media. So, you need to install SSIS service on the machine where the SSIS packages jobs run.
    References:
    http://www.bigator.com/2012/03/11/ways-to-execute-ssis-package/
    http://www.codeproject.com/Articles/219494/SSIS-Overview-Part-I
    Regards,
    +1
    You need to install Integration Services, which installs the necessary bytes on your computer and the SSIS service as well. The service can be disabled though, you don't need it to run packages.
    I wrote a blog post about it some time ago:
    When is DTEXEC installed?
    ps: osql is deprecated. Better start using sqlcmd.
    MCSE SQL Server 2012 - Please mark posts as answered where appropriate.

  • How can i get sample CSV files for Demo BI Content

    Hello Experts. Documentation say that there is sample CSV files for modules that come with delivered BI content. I am planning to work with the demo content which i have already installed. I then need to populate the objects with the relevant demo data that is said to be in the CSV files that come with the demo content. Please let me know from where i can get these CSV files. Good day.

    Hi Huggins,
    There are sample csv data in AL11 in the work directory.  You may want to look through here to see if the csv files you require are there.
    Thanks,
    Nick.

  • Get a CSV file in a URL

    I must get a .CSV file of Exchange Rates in the URL:
    <http://www5.bcb.gov.br/pec/taxas/ingl/PtaxRPesq.asp?idpai=QUOTATIONS>
    Is it possible on XI? If yes, how can i do it?
    I'll use the information in this file to update fields in SAP R/3.
    Regards,
    Daniela

    Moorthy,
    Thank you for your help.
    Would you be more specific about the logic?
    My data will be in a CSV. format. This file is in a Government site, because ìt's a list of Exchange Rates.
    The site is http://www.bcb.gov.br/?TXTODAS
    I have already use SOAP adapter to change information with a WebService, but what I need now is get a File in a Web Page (with is not my client webservice).
    Is it possible?
    Regards,
    Daniela

  • Getting empty csv file using servlet

    Hi
    i am working on reports for my web application and i used struts frame work.
    for my reports i want csv export, so for that i written servlet, once if i click generate button i am able to open popup window to save the generated csv file at my local system, but i am getting emplty csv file..
    nothing si ther ein that file forget abt data atleast my header fields.
    here is my servlet file..plz let me know where i am doing wrong..
    public class ReportServlet extends HttpServlet{
         public void doPost(HttpServletRequest req,HttpServletResponse res)
    throws ServletException,IOException
    PrintWriter out = res.getWriter();
    res.setContentType("text/csv");
    res.setHeader("Content-Disposition","attachment; filename=\"export.csv\"");
    out = res.getWriter();
    AdvDetailReportBean reportBean = null;
    ArrayList list =(ArrayList)req.getSession().getAttribute("advreportlist");
    System.out.println(" servlet report list size is"+list.size());
    String branchcode=(String)req.getSession().getAttribute("branchcode");
              String bName=(String)req.getSession().getAttribute("branchname");
              System.out.println(" servlet branch name"+bName);
              System.out.println(" servlet branch code"+branchcode);
    StringBuffer fw = new StringBuffer();
              fw.append("Branch Code");
              fw.append(',');
              fw.append("Branch Name");
              fw.append('\n');
              fw.append(branchcode);
              fw.append(',');
              fw.append(bName);
              fw.append('\n');                              
              fw.append('\n');
              fw.append("Customer Name");
         fw.append(',');
         fw.append("Constitution Code");
         fw.append(',');
         fw.append("Customer Status");
         fw.append(',');
         fw.append("Restructure Date");
         fw.append(',');
         fw.append("Total Provision");
         fw.append(',');
         fw.append("Limit Sanctioned");
         fw.append(',');
         fw.append("Principal");
         fw.append(',');
         fw.append("Balance");
         fw.append(',');
         fw.append("AccountID");
         fw.append(',');
         fw.append("Collateral SL No");
         fw.append(',');
         fw.append("Issue Date Of Collateral");
         fw.append(',');
         fw.append("MaturityDate Of Collateral");
         fw.append(',');
         fw.append("Subsidy");
         fw.append(',');
         fw.append("Guarantor SL No");
         fw.append(',');
         fw.append("Guarantor Rating Agency ");
         fw.append(',');
         fw.append("External Rating of Guarantor");
         fw.append(',');
         fw.append("Rating Expiry Date");
         fw.append(',');
         fw.append("Guarantee Amount");
         fw.append(',');
         fw.append('\n');
         for (Iterator it = list.iterator(); it.hasNext(); )
              reportBean = new AdvDetailReportBean();
              reportBean = (AdvDetailReportBean)it.next();
              fw.append(reportBean.getCustomername());
              fw.append(',');
              fw.append(reportBean.getConstitutionCode());
              fw.append(',');
              fw.append(reportBean.getCustomerStatus());
              fw.append(',');
              fw.append(reportBean.getRestructureDate());
         fw.append(',');
         fw.append(reportBean.getTotalProvision());
         fw.append(',');
         fw.append(reportBean.getLimitSanctioned());
         fw.append(',');
         fw.append(reportBean.getPrincipal());
         fw.append(',');
         fw.append(reportBean.getBalance());
         fw.append(',');
         fw.append(reportBean.getCurrentValue());
         fw.append(',');
         fw.append(reportBean.getAccountNumber());
         fw.append(',');
         fw.append(reportBean.getColCRMSecId());
         fw.append(',');
         fw.append(reportBean.getIssueDt());
         fw.append(',');
         fw.append(reportBean.getMarturityDt());
         fw.append(',');
         fw.append(reportBean.getUnAdjSubSidy());
         fw.append(',');
         fw.append(reportBean.getGuarantorFacilityId());
         fw.append(',');
         fw.append(reportBean.getRatingAgency());
         fw.append(',');
         fw.append(reportBean.getExternalRating());
         fw.append(',');
         fw.append(reportBean.getExpDtOfRating());
         fw.append(',');
         fw.append(reportBean.getGuaranteeAmt());
         fw.append(',');
         fw.append('\n');
    }

    You don't seem to be writing anything to the response at all. Yes, you create a StringBuffer and write lots of stuff to the StringBuffer but then you do nothing else with that buffer.

  • Example for loading a csv file into diadem from a labview application

    Hi everyone, i'm using labview 8.2 and DIAdem 10.1.
    I've been searching in NI example finder but I had no luck so far.
    I have already downloaded the labview connectivity VIs.
    Can anyone provide a example that can help me loading a csv file into diadem from a labview application?
    Thanks

    Hi Alexandre.
    I attach an example for you.
    Best Regards.
    Message Edité par R_Duval le 01-15-2008 02:44 PM
    Romain D.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    NIDays 2010 : Conférence mondiale de l'instrumentation virtuelle
    >>Détails et Inscription<<
    Attachments:
    Classeur1.csv ‏1 KB
    Load CSV to Diadem.vi ‏15 KB

  • Can we stop shared server from client m/c

    Hi all,
    Can we stop Oracle Shared and Dedicated server from Client Machine if i am connecting through SYSDBA.
    Thanks
    Vipin

    > Can we stop Oracle Shared and Dedicated server from Client Machine if i am
    connecting through SYSDBA.
    Yes. No.
    Yes, you can stop shared server. Simply decrease the shared server pool to zero. (see below for details)
    No, you cannot stop a dedicated server as "The Thing" that creates dedicated server connections is the Listener. So you will need to stop that.
    # stop shared server:
    SQL> show parameter shared_servers
    NAME TYPE VALUE
    max_shared_servers integer 20
    shared_servers integer 10
    SQL> alter system set shared_servers=0 scope=memory;
    System altered.
    # now attempt a shared server connection
    /home/billy> sqlplus scott/tiger"(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL=TCP)(HOST=dev)(PORT=1521))) (CONNECT_DATA = (SID=dev) (SERVER=shared)))"
    SQL*Plus: Release 10.2.0.1.0 - Production on Wed Sep 5 12:21:06 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    ERROR:
    ORA-12519: TNS:no appropriate service handler found
    # start the shared server (in the SYSDBA session)
    SQL> alter system set shared_servers=10 scope=memory;
    System altered.
    # now attempt a shared server connection
    /home/billy> sqlplus scott/tiger@"(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL=TCP)(HOST=dev)(PORT=1521))) (CONNECT_DATA = (SID=dev) (SERVER=shared)))"
    SQL*Plus: Release 10.2.0.1.0 - Production on Wed Sep 5 12:21:17 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning and Data Mining options
    SQL>

  • VISA: How to get the CSV file through C/C++ code?

    How to get the CSV file through C/C++ code?
    I'm communicating with a USB oscilloscope using VISA.

    Thank you for your reply.
    I am using Apache Commons File Upload. Here is the code where I got the "fi".
         DiskFileUpload fu = new DiskFileUpload();
              fu.setSizeMax(1000000000);
              List fileItems = fu.parseRequest(request);
             Iterator itr = fileItems.iterator();
              FileItem fi = (FileItem)itr.next();
              if(!fi.isFormField())
                File tempFileRef  = new File(fi.getName());
         System.out.println("Field = "+tempFileRef.getAbsolutePath());
         }

  • Connect 11g server from client

    Hi,
    i have 11g daatabase and 11 g client. can u please help me to connect 11g server from client
    pls help with steps
    thanks

    Chinu wrote:
    Hi,
    i have 11g daatabase and 11 g client. can u please help me to connect 11g server from client
    pls help with steps
    thankssqlplus
    / as sysdba
    Handle:      Chinu
    Status Level:      Newbie
    Registered:      Sep 19, 2009
    Total Posts:      323
    Total Questions:      123 (102 unresolved)
    why so MANY unresolved questions?

  • Get data from file in server to client and vice versa

    after greeting
    i really didn't know how to use socket and serversocket to get data from file in the server and display it to client.
    also read file from client and save it to server.
    really i didn't know how to do it.
    really i want the reply as soon as possible

    You REALLY need to work through the Java networking tutorials:
    http://java.sun.com/docs/books/tutorial/networking/index.html

Maybe you are looking for