JSP Writing to file on the client machine

Hi Java Gurus,
I would like to know if it's possible to store (save) information to a file on a client machine from a JSP Application?
Or let me know good tips to save some data on the client machine... Thanks a lot!
Nalee

Hi Gallegux,
Sorry, I don't mean to sound dense. Here is my JSP page. Do you mean physically on the same line or logically on the same line?
<%response.setHeader ("Content-Disposition","attachment;filename=xxx.txt"); %>
<%@ page import="java.sql.*" %>
<%@ page extends="someone.taglib.servlet.MyDialogServlet" %>
<%@ page contentType="application/save; charset=iso-8859-1" language="java" import=""%>
<%@ page import="MyProductBean" %>
.....body of JSP........
Thanks so much!

Similar Messages

  • Search for a file in the client machine

    hai..
    i m currently working on a client server appication.i would like to perform a search in the client machine...
    to b more specific...i would like to search for a .exe file in the client machine.if that file is not present in the client machine then copy that particular file from the server to client and if that file is present in the client machine then execute that file...
    plz help me with this task..
    thank u

    @OP: were you, by any chance, a member of Microsoft's Windows XP
    design team?
    kind regards,
    Jos ;-)

  • Creating file in the client machine

    Hello All,
    In my jsp page, am writing data from database to an excel file and I want this excel file to be created in the client machine. I checked in the forums but could not find an apt reply.
    ie, when i click on submit button, i get the data from the database and put it in an excel file.
    any help would be appreciated.
    am realy struggling with this.
    any link to previous posts regarding this would be very helpful.
    thankx a ton,
    arun.

    you can't write a file from the server to the client. Such functionality would make it really easy to install virusses and such, don't you think? You can write the excel file on the server and then allow the user to download that file. This would mean writing the file to a webdir and then offering it as a link on a webpage.
    Check out the apache website for jakarta POI, which allows writing (and reading) of excel files.
    http://jakarta.apache.org

  • Writing a log file in the client machine

    Hello,
    I need to write a kind of log file about the successful or failure of execution of
    some queries in a PL/SQL batch. The UTL_FILE.fopen command let me write to a file but in the side of the server. And it's necessary to update the init.ora with the path.
    That's not useful for me. I want a procedure generates a report for the clients.
    Is this posible?
    Thank you very much,
    Icaro Alzuru

    I want a procedure generates a report for the clients.Well, one way to do it is to write a file to the DB server and then use some OS mechanism to make it available to the client (ftp, e-mail). With moderate degrees of pffafing around this can all be done from inside the database.
    Alternatively, write to a log table instead and make that available to the client. Depending on who they are they might prefer querying a table to grep'ing through a file.
    Cheers, APC

  • Saving The Report File (PDF) on Client Machine/PC

    Hi Everyone,
    I am using Oracle Application Server 10g (10.1.2). I have a form that calls a report (both forms and report version are 10.1.2) with ASYNCHRONOUS option and creates a file in PDF format. The report is running fine and is creating the PDF file fine BUT on the application server.
    I need to know if there is a possibility of either creating the file on the client machine/pc or transferring the file from application server to client PC. I would prefer the first option that is to create the file on client PC so the client can print or browse the report later. The second option would be ok if there is no solution for first option but I am assuming that it would take twice as much time. First to create the report on Application Server then to transfer the file from AS to client PC.
    I have already included webutil library and object library but could not find a way to save the file on client PC using any of the APIs.
    I would appreciate if some one provide me detail information. I mean syntax on how to either create the file on client PC or how to transfer the file created on application server to client PC. I would like to know where the report is created on Application server as the path will be required for transfer.
    Thanks in advance.
    Khalid

    Instead of just creating the file, open the file in a
    browser using rwservlet. That way the client can see
    it and save in his PC whenever he wants to.
    Try:
    ...write code to get report id...you must be already
    having this...
    then continue....
    :global.report_server_name:=<servername>;
    reports_servelet:='/reports/rwservlet';
    REPORT_MESSAGE := RUN_REPORT_OBJECT(REPORT_ID);     
    vjob_id :=
    substr(report_message,length(:global.report_server_na
    e)+2,length(report_message));
    hidden_action :=
    reports_servelet||'/'||'getjobid'||vjob_id||'?server='
    ||:global.report_server_name;
                                       --WEB.SHOW_DOCUMENT(hidden_action);
    Basically you get the objid for the report you ran
    and open it in the browser.
    Hope this helps.Hi,
    First of all thanks for you kind reply. Actaully user has an option to preview report and it is working fine. The reports run and display under browser as either PDF or HTML depending on option selected by user. These reports can be saved on client machine without any problem as you mentioned.
    The problem with this form is that as soon as it execute the report it exit out of form. So the reports that are previewed run under SYNCHRONOUS mode and reports that are creating files run in ASYNCHORONOUS mode. I can run preview reports also in ASYNCHOROUS mode and I have already tried it by creating TIMER and WHEN_TIMER-EXPIRED trigger and commenting EXIT_FORM built-in. But as mentioned since the form exit out WHEN_TIME_EXPIRED does not fire and it does not display the report on the browser. I can see the status of the report in print queue when it is finished successfully.
    If the report is not displayed after running in ASYNCHOROUS mode then I will be unable to save the file. That is the reason we created the FILE creation option and thought we will find a way to create/save the file on client PC but I am having hard time to do that.
    I am sure I have made myself clear. Bottom line is that previewing a report in a browse is an option but will not work for long reports and if we run in background then it will not display in a browser as form exits after calling the run_report_object to run report so WHEN-TIMER-EXPIRED is not there to show the report when it is finished.
    Thanks
    Khalid

  • Saving the PDF on the client machine

    Dear SDN Community,
      I have a requirement to save the PDF file on the client machine. Can you please advice me what are the options that I do have.
    P.S : I use 2004s, Adobe Life cycle desginer 7.1 for the development.
    Thanks!
    Surya

    Anto,
      Thanks for your reply. Can you please tell me if I can force the user to save the document on to his desktop. I need to provide him a dialogue box to save to his computer. Please advice me how I can do this programetically.
    Thanks!
    Surya.

  • How can I display the front panel of the dinamically loaded VI on the cliente computer, the VI dinamically loaded contains files, I want to see the files that the server machine has, in the client machine

    I can successfully view and control a VI remotly. However, the remote VI dinamically loads another VI, this VI loaded dinamically is a VI that allows open others VIs, I want to see the files that contains the server machine, in the client machine, but the front panel of the dinamic VI appears only on the server and not on the client, How can I display the fron panel with the files of the server machine of the dinamically loaded VI on the client computer?
    Attachments:
    micliente.llb ‏183 KB
    miservidor.llb ‏186 KB
    rdsubvis.llb ‏214 KB

    I down loaded your files but could use some instructions on what needs run.
    It seems that you are so close yet so far. You need to get the data on the server machine over to the client. I generally do this by doing a call by reference (on the client machine) of a VI that is served by the server. THe VI that executes on the server should pass the data you want to diplay via one of its output terminals. You can simply wire from this terminal (back on the client again) to an indicator of your choosing.
    Now theorectically, I do not think that there is anything that prevents use from getting the control refnum of the actual indicator (on the server) of the indicator that has the data, and read its "Value" using a property node. I have never tried this idea but it seems t
    hat all of the parts are there. You will need to know the name of the VI that holds the data as well as the indicator's name. You will also have to serve all VI's. This is not a good idea.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to get file input stream from the client machine by JSF Fileupload API?

    Dear Friends,
    How to get the file input stream from the client machine by JSF HtmlFileupload or fileupload API. At present, if i execute the file upload code in the client machine, it is able to get the local path of the file and looking for the file in server machine. So i am getting FileNotFoundException.
    E.g., If a file is located at client machine at following location means "C:\Test\Test.txt",
    uploadClass.getFileuploadComponent().getFilename().toString() returns "C:\Test\Test.txt". But it is looking for that file in server and throwing FileNotFoundException.
    Please post your replies soon.
    Thanks,
    JP

    Depends on which version of JSF you're using. If JSF 1.2, I wouldn't even bother trying to hack this into JSF itself unless you can use something like Seam 2 or richfaces.
    http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_fileUpload.html
    http://docs.jboss.org/seam/2.2.1.CR3/reference/en-US/html/controls.html#d0e29259 (look for s:fileUpload)
    But if I were you, a simple non-jsf form with a servlet works best for taking file uploads.
    As for JSF 2.0, there are other ways of getting it done.
    http://balusc.blogspot.com/2009/12/uploading-files-with-jsf-20-and-servlet.html

  • How to load a excel sheet on the client machine from jsp

    hai all,
    I want an excel sheet to be opened like "c:\excelsheet.xls" on the client machine from my JSP so that i can send the out put of my jsp to it.i will press a button on jsp and i want the query out put in the excel sheet. if it is already opened then it has to be closed and reopened with new data, the old data has to be lost.
    can any one help me out....
    Thanks for any help...
    regards,
    ravikiran

    Hai friend,
    you add mime type in web.xml
    for example,
    <mime-mapping>
    <extension>xls</extension>
    <mime-type>application/excel</mime-type>
    </mime-mapping>

  • How to upload file from a client machine to server machine

    hei evryone!
    can anyone pls help me on how i can upload file from a client machine to another machine (or server). using jsp.Then later on, i can also retrieve the names of these files to place it as values for option tag in an html form.I have a seperate screen for uploading the file and the screen for displaying all the files that were uploaded on the server...
    any sample code/ ideas would be much appreciated.Thx!!!!

    hei evryone!
    can anyone pls help me on how i can upload file from a client machine to another machine (or server). using jsp.Then later on, i can also retrieve the names of these files to place it as values for option tag in an html form.I have a seperate screen for uploading the file and the screen for displaying all the files that were uploaded on the server...
    any sample code/ ideas would be much appreciated.Thx!!!!

  • SharePoint Designer 2013 after installation getting error with runtime i.e. error writing to file Microsoft.SharePoint.Client.Runtime.Local.Resources.dll Verify that you have access to that directory

    SharePoint Designer 2013 after installation getting error with runtime i.e. error writing to file Microsoft.SharePoint.Client.Runtime.Local.Resources.dll Verify that you have access to that directory
    after retry..again SharePoint Designer requires the following component require to install Microsoft.NET framework version 4 i have downloaded and try to installed but fail not work please answer what to do?
    Thanks and Regards, Rangnath Mali

    Hi Rangnath,
    For running SharePoint Designer 2013, you need to install Microsoft .NET 4.0 Framework or higher.
    Please uninstall the Microsoft .NET 4.0 Framework, and install it again. After that, reboot your machine.
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

  • Access denied error while writing a file to the file system - myfileupload.saveas() throws system.unauthorizedexception

    hi,
    as part of my requirement , i have to perform read and  write  operations of  few files [ using the file upload control in my custom visual web part] and on submit button click.
    but while writing these files - with the help of  fileupload control - and when i use  myfileupload.saveas(mylocation);
    - i am saving these files into my D:\ drive of my server , where i am executing my code -, am getting access denied error.
    it throws system.unauthorizedexception.
    i have given full control on that folder where i was trying to store my attached files. and also  after following asp.net forums,
    i have added  iusr group added and performed all those steps such that, the file is saved in my D:\ drive.
    but unfortunately  that didnt happen.
    also
    a) i am trying the code with runwithelevatedprivileges(delegate() )  code
    b) shared the drive within the  d :drive where i want o save the files.
    c) given the full privieleges for the app pool identity- in my case , its
    network service.
    the  other strange thing is that, the same code works perfectly in  other machine, where the same sp, vs 2012  etc were installed .
    would like to know, any other changes/ steps i need to make it on this  server, where i am getting the  error.
    help is  appreciated!

    vishnuS1984 wrote:
    Hi Friends,
    I have gone through scores of examples and i am failing to understand the right thing to be done to copy a file from one directory to another. Here is my class...So let's see... C:\GetMe1 is a directory on your machine, right? And this is what you are doing with that directory:
    public static void copyFiles(File src, File dest) throws IOException
    // dest is a 'File' object but represents the C:\GetMe1 directory, right?
    fout = new FileOutputStream (dest);If it's a directory, where in your code are you appending the source file name to the path, before trying to open an output stream on it? You're not.
    BTW, this is awful:
    catch (IOException e)
    IOException wrapper = new IOException("copyFiles: Unable to copy file: " +
    src.getAbsolutePath() + "to" + dest.getAbsolutePath()+".");
    wrapper.initCause(e);
    wrapper.setStackTrace(e.getStackTrace());
    throw wrapper;
    }1) You're hiding the original IOException and replacing it with your own? For what good purpose?
    2) Even if you had a good reason to do that, this would be simpler and better:
    throw new IOException("your custom message goes here", e);
    rather than explicitly invokign initCause and setStackTrace. Yuck!

  • Accessing print services in the client machine(browser)

    Query: We had migrated a forms-3 form to forms-6i. The forms-3 form used a userexit to call a related Pro*C functionality that helped finally to print the report file generated during the process into the client machine's printer.
    How do we take care of this functionality in forms-6i? That is, the user should be able to do the printing from the forms screen in the browser..
    Please help..

    Thank you for replying..
    We have earlier tried the web.show_document procedure to call the .html or .txt file....But in forms-3(back-end on a UNIX server with the Pro*Cs), an ascii file was created at the server side in the client's home directory, and this file was accessed and used from the front-end machine(a UNIX terminal or a QVTTerm like application on Windows), to be printed out onto the printer device configured on the client machine...As in your reply, through web.show_document also the printing can be finally done..But the user has to wait for the new browser window to get opened and show the content and then print it...These steps were not needed in forms-3, that is, on a click of the print-related-button, it did the job...So, in the same way, can something be done on the forms-6i form(use a printer-javabean or something else), to get the functionality???
    Please help..

  • How to refresh XML file  from my client machine

    Hai All
    I have temp.XML and temp.XSL template in our server machine.
    when i give a print from client machine first time it gives the record,and next time it did not get refresh.Always it shows the previous records in the browser.But when i go into the server machine and click on temp.xml,it shows the current record(correct records)
    How to refresh XML file  from my client machine?
    Regards
    Dhina

    You never delete a Time Machine backup by dragging it to the Trash. You are supposed to use the TM application to manage the backups. What you will need to do now is to simply erase the drive using Disk Utility.

  • What are the Client machine requirements for running Forms 6i?

    What are the minimum/ideal hardware requirements of the client machines which run forms 6i in separate frames.
    The reason for asking this is that the users have multiple sessions of separate Forms frames. When they do a lot of activity/transactions, and try to do a windows Print Screen on a MSWord file, nothing seems to print on the Word document. If they save the document and reboot the computer and open the same word document again then the screen print shows up. I am thinking it is because the separate frames take up lot of RAM. Typical configurations of our m/c are PII 400's with 64MB RAM.
    Thanks in advance.

    Hi Lionel,
    As a general rule of thumb, the ATI Rage 128 Pro will not support a 20" LCD. That being said, there are reports of it doing just that (possibly the edition that went into the cube).
    I'm not that familiar with the ins and outs of the Cube, so I can't give you authoritative information on it.
    A good place to start looking for answers is:
    http://cubeowner.com/kbase_2/
    Cheers!
    Karl

Maybe you are looking for