Automatically save file in server side...

how can i save a file(text or excel) automatically without anyuser intervention?
lets say a query is done and the result of that query is goin to save into a file(textfile or excel file) how im i going to save it in the server side? maybe a there is a foldername /extract file/.
Hope somebody can help me... Thanks in advanced!

hello again.. this is a part of my codes that writes text files into the server
public void ReadWrite(ActionForm form){
    AdminAccountBean adminForm = (AdminAccountBean)form;
    String directory1="";
    String directory2="";
    File f = new File("DBConn.txt");
    File f1 = new File("DBConn1.txt");
    String dconnectString = "jdbc:oracle:thin:@"+adminForm.getDserv()+":"+adminForm.getDport()+":"+adminForm.getDbname();
    String dconnectString1 = "jdbc:oracle:thin:@"+adminForm.getDserv1()+":"+adminForm.getDport1()+":"+adminForm.getDbname1();
    try{
    boolean success = (new File(adminForm.getDirectory())).delete();
    if (!success) {
        System.err.println("Error on deleting previous file");
    }catch(Exception e){
      e.printStackTrace();
    directory1 = f.getAbsolutePath().toString();
    directory2 = f1.getAbsolutePath().toString();
    try{
    boolean success = (new File(f.getAbsolutePath().toString())).delete();
    if (!success) {
        System.err.println("Error on deleting previous file");
    }catch(Exception e){
      e.printStackTrace();
    try{
    boolean success = (new File(f1.getAbsolutePath().toString())).delete();
    if (!success) {
        System.err.println("Error on deleting previous file");
    }catch(Exception e){
      e.printStackTrace();
   Convert co = new Convert();
   /*try {
        BufferedWriter adminto = new BufferedWriter(new FileWriter(directory));
        adminto.write(co.Encoder("encoded"));
        adminto.write("\n");
        adminto.write(co.Encoder(uname));
        adminto.write("\n");
        adminto.write(co.Encoder(pword));
        adminto.close();
    } catch (IOException e) {
    e.printStackTrace();
    try{
    boolean success = (new File(directory1)).delete();
    if (!success) {
        System.err.println("Error on deleting previous file");
    }catch(Exception e){
      e.printStackTrace();
    try {
        DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
        Connection conn = DriverManager.getConnection(dconnectString,adminForm.getDuname(),adminForm.getDpword());
        conn.setAutoCommit (false);
        String sqldelete ="DELETE FROM GIIS_WEB_ADMIN";
        PreparedStatement stmt = conn.prepareStatement(sqldelete);
        stmt.executeUpdate();
        String sql ="INSERT INTO GIIS_WEB_ADMIN VALUES('"+adminForm.getUname()+"','"+co.Encoder(adminForm.getPword())+"','A','encoded')";
        PreparedStatement  pstmt = conn.prepareStatement(sql);
        pstmt.executeUpdate();
        conn.commit();
        conn.close();
        Decode de = new Decode();
        String encoded2 = co.Encoder(dconnectString1);
        BufferedWriter adminto1 = new BufferedWriter(new FileWriter(directory1));
        adminto1.write(co.Encoder(dconnectString));
        adminto1.write("\n");
        adminto1.write(co.Encoder(adminForm.getDuname()));
        adminto1.write("\n");
        adminto1.write(co.Encoder(adminForm.getDpword()));
        adminto1.write("\n");
        adminto1.write(co.Encoder(adminForm.getDsid()));
        adminto1.write("\n");
        adminto1.close();
        BufferedWriter adminto2 = new BufferedWriter(new FileWriter(directory2));
        adminto2.write(co.Encoder(dconnectString1));
        adminto2.write("\n");
        adminto2.write(co.Encoder(adminForm.getDuname1()));
        adminto2.write("\n");
        adminto2.write(co.Encoder(adminForm.getDpword1()));
        adminto2.write("\n");
        adminto2.write(co.Encoder(adminForm.getDsid1()));
        adminto2.write("\n");
        adminto2.close();
    } catch (Exception e) {
    e.printStackTrace();
  }

Similar Messages

  • Trying to save files on "PC" side of Mac, using a FreeAgent external harddrive.  I get the error message E:/not accessible or something similar.  Can I not use an external harddrive, if not, what is the best way to back up PC side of a Mac

    Trying to save files on "PC" side of Mac, using a FreeAgent external harddrive.  I get the error message E:/not accessible  access denied.  Can I not use an external harddrive, if not, what is the best way to back up PC side of a Mac

    Apple has really crappy NTFS read-only that does not always work. And it is probably a licensing issue.
    Paragon Software is constantly being updated and supported with their NTFS for Mac OS X - they also have an HFS+ driver for Windows that works - Apple's HFS+ read-only driver for Boot Camp / Windows does not.
    I keep seeing problems and lack of support for MacFUSE, that could change.
    http://www.bing.com/search?q=ntfs+for+mac

  • How to make html file on server side from the data entered in text area

    Hi!
    I want to know how to make .html file on server side. Like if i enter the data in text area ( or like we normaly see when we write mail that editor) and we can use html tages in it and when user submit form all the data in that field will be saved on server side as an html formate. Is it possible to do so??? or any ruff idea how to design it???

    Erm ...
    Whats the problem with that?!
    Ok, here the code ...
    String myparameter = request.getParameter("paramname");
    String htmltemplate = "<html>\n"
                         +"<head><title>demo</title></head>\n";
                         +"<body>@parametertag@</body>\n";
                         +"<html>";
    String htmlpage = htmltemplate.replaceAll("@parametertag@",myparameter);
    File yourHTMLfile = new File("wheredoyouwannagotoday.html");
    FileOutputStream fos = new FileOutputStream(yourHTMLfile);
    fos.write(htmlpage.getBytes());
    fos.close();You're done.
    Happy Coding! :-) &copy;

  • Copy a .swf file from server side to client using signed applet

    Hello All,
    I already have my applet signed and its working pretty well. However I want to know how can I import a .swf file into clients machine. The .swf file initially is on server side, my applet checks whether this .swf file exists already on client machine. If not it copies it to his machine.
    I know how to chk if the file already exits on client machine but I am not sure how to copy this .swf file to his machine if its missing.
    May be I need to set some input buffers from server side and then copy them to his machine.
    Can some one throw some light on this issue ??

    Hello to all Java Code Masters out thr,
    I am trying to copy a .swf file from server side to client side, however I am unsuccessful in writing the correct data. By correct data I mean that , the data does gets saved on the client side in the .swf file, and the size of the .swf file on client side is as expected, but some how I don't know why the data is not the same as expected.
    I tried opening up both the swf file, one which is on server side and the other which is on client side. And both looked different in the notepad.
    When I opens up the client side .swf file on browser it shows nothing while the .swf file on server side worked fine.
    Here is a snap shot of the two .swf files when opened in notepad:
    clientside.swf
    &#22339;&#2131;&#51395;&#40056;&#48612;&#28681;&#56220;&#6234;&#31352;&#65363;&#27474;&#26039;&#46793;&#52076;&#11698;&#45679;&#32228;&#9617;&#45643;&#52076;&#54002;&#56237;&#62930;&#57181;&#27635;&#46965;&#48804;&#30062;&#60407;&#31086;&#2937;&#37359;&#28873;&#49741;&#8252;&#10112;&#503;&#8501;&#16164;&#43397;&#16140;&#10313;&#8264;&#537;&#13737;&#16956;&#43411;&#586;&#4917;&#43544;&#22918;&#4216;&#49632;&#40179;&#64495;&#64206;&#44335;&#61334;&#19077;&#57113;&#61099;&#53246;&#52863;&#52855;&#52985;&#32246;&#63967;&#27542;&#13055;&#32611;&#52219;&#26476;&#56728;&#25064;&#57340;&#63580;&#65317;&#56023;&#32706;&#57446;&#19865;&#24183;&#40928;&#65057;&#61684;&#25313;&#64294;&#45864;&#44950;&#25919;&#7115;&#8035;&#44004;&#31973;&#18921;&#32575;&#18967;&#25451;&#63915;&#44668;&#30262;&#32651;&#11230;&#60116;&#21241;&#51902;&#30302;&#2462;&#38913;&#38887;&#2904;&#47227;&#11350;&#25775;&#35978;&#25879;&#38313;&#61967;&#15065;&#8627;&#33840;&#11456;&#12040;&#52418;&#33633;&#6640;&#63050;&#65270;&#39008;&#42184;&#40462;&#49876;&#16324;&#15399;&#60051;&#62263;&#26562;&#19076;&#47084;&#16512;&#51385;&#58710;&#13280;&#42314;&#13071;&#55199;&#17948;&#14772;&#61464;&#8985;&#9032;&#16254;&#42612;&#16367;&#47121;&#16212;&#60451;serverside.swf
    CWS�� x���     p��ZxzS�Rk�e��l��-o��}�%K�l�������]��ku���nu��nyy���pM�< �'�5!$����I
    (H �
    5<B
    ��J5��Yx��������/����J������w����}���
    k�2c��lg���a��\�%��serverside.swf is what I expect to be saved, but clientside.swf is what i get.
    Below is a code snippet which I am trying :
      public void writeswftoclient(String swfcontent) {
        String userHome = System.getProperty("user.home" );
        String ImoracleDirectory = userHome + "\\MyFolder";
        File fdirectory = new File(ImoracleDirectory);
        if(!fdirectory.isDirectory()) {
          fdirectory.mkdir();
        String playlist = ImoracleDirectory + "\\clientside.swf";
        File fplaylist = new File(playlist);
        try {
          Writer output = null;
          output = new BufferedWriter(new FileWriter(fplaylist,true));
          *System.out.println(swfcontent);*
          *output.write(swfcontent);*
          output.close();
        catch (Exception e) {
          System.out.println("Cannot create or write to the playlist");
      }In above code I am trying to write the string swfcontent, which contains the data shown above in serverside.swf, to clientside.swf.
    Interesting thing is that I am doing System.out.println(swfcontent); just before writing the data to clientside.swf using output.write(swfcontent);. And System.out.println does print the write data on the java console. However I dont know out of what reason the data doesnt get written correctly on the client's computer.
    Kindly help me in this plzzzzzzzzzz.

  • How do I tell FMS to only serve a section of a file using server-side ActionScript?

    We have a bunch of mp3 files on our server and we'd like to serve only particular sections of particular files to users.  For example, hello.mp3 might be four minutes long, but when user 1 tries to play it, he should only be able to play the section from 0:30 to 1:00, whereas user 2 should be able to play the whole thing.
    I'm coming from a background using Wowza Media Server, where this is fairly easy to achieve: http://fmsguru.com/showtutorial.cfm?tutorialID=78.
    Wowza doesn't require any change to the player (it doesn't call any special methods), so I'm looking for the same here.
    I've been fiddling around with the main.asc file and the "Server-Side ActionScript" API to try and achieve something similar.  In particular I've found the Stream.play method, which seems relevant.  But I can't figure out how to attach a handler to a "play" event; all the examples I've seen only attach to Application.onConnect, which doesn't seem to include a connection to a particular file, which I need in order to determine the section that can be played.
    So I'd like to do something along the lines of this (this is completely made up and doesn't follow any of the APIs; it's just an illustration of what I'm trying to achieve):
    application.onConnect = function(client) {
       client.onPlay = function(stream) { // Client.onPlay doesn't exist; what should I do here?
           var section = getStreamSection(client, stream);
           stream.play(section.start, section.end);
    var getStreamSection = function(client, stream) {
       return { start: 30, end: 60 }; // Return value is based on the user's credentials and the file they're trying to stream

    You can find the documentation for Plug-ins here:
    http://help.adobe.com/en_US/flashmediaserver/plugin_apiref/index.html
    http://help.adobe.com/en_US/flashmediaserver/devguide/WS5b3ccc516d4fbf351e63e3d11a0d662434 -7ff6PluginAPI.html
    Basically you need to concentrate on E_PLAY event and two fields F_STREAM_LENGTH & F_STREAM_POSITION. I am pasting below some code which you need to paste in your sample Auth Plug-in which you can find in : <installdir>/samples/plug-ins. You would have paste below code in case E_PLAY section in MyFmsAuthorizeEvent::authorize() function and compile it. You would basically get AuthModule.dll which you need to place in modules/auth and restart FMS.
    // Set the Stream to be played back only for 10 seconds starting from 10 th second
                                  // Stream will play from 10th Second to 20th Second
                                     float fValue;
                                  char buf[1024];
                                  if (getFloatField(m_pAev, IFmsAuthEvent::F_STREAM_LENGTH, fValue))
                                            float fLength = fValue; // in seconds
                                            sprintf(buf,"Original Stream length value passed from player %f\n",fLength);
                    m_pFmsAuthServerContext->log(buf, IFmsServerContext::kInformation, false);
                                            fLength=10.0;
                                            sprintf(buf,"Modifying Stream length value passed from player %f\n",fLength);
                    m_pFmsAuthServerContext->log(buf, IFmsServerContext::kInformation, false);
                                            setFloatField(m_pAev,IFmsAuthEvent::F_STREAM_LENGTH,fLength);
                                  if (getFloatField(m_pAev, IFmsAuthEvent::F_STREAM_POSITION, fValue))
                                            float iPosition = fValue; // in seconds
                                            sprintf(buf,"Original Stream Position value passed from player %f\n",iPosition);
                    m_pFmsAuthServerContext->log(buf, IFmsServerContext::kInformation, false);
                                            iPosition=10.0;
                                            sprintf(buf,"Modifying Stream length value passed from player %f\n",iPosition);
                    m_pFmsAuthServerContext->log(buf, IFmsServerContext::kInformation, false);
                                            setFloatField(m_pAev,IFmsAuthEvent::F_STREAM_POSITION,iPosition);

  • How to upload and download a file in server side program

    Give me a sample code for the file upload and download using Server side program.

    You should try one of these forums for an answer to your question:
    http://swforum.sun.com/jive/forum.jspa?forumID=116
    http://community.java.net/netbeans
    http://linux.java.net

  • Write to text file without server side

    Hi,
    I need to write data into a text file for saving data from my
    flash movie, but I didn't have the possibility to use a
    server-side.
    Because my flash movies are stored on a CD and it must be
    compatible with Windows and MacOS.
    Is it possible to write data into a text file?
    If no, can I use a third party software? Which one?
    Regards
    YamNet

    A SharedObject might work for you. Otherwise, you'll need a
    'wrapper' app.
    Adobe's own Director works very well for this, and AIR would
    work as well.
    There are also a good number of 3rd party apps, such as Zinc
    and others.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • How do I tell my Mac to automatically save files to an external hard drive instead of the on-board storage?

    My question is: how do I make my Mac save file automatically to my external hard drive? I don't want to have a bunch of storage on my computer taken up because I can't save it to my external hard drive. I have an early 2014 MacBook Air 13.3" 128GB hard drive. As you can see I don't have a whole lot of space for files. I would prefer for them to be on the external hard drive.Thanks,

    Many applications will remember the last saved folder but some like Microsoft Word will allow you to set a default location.
    There is a third party app that you might want to check out called DefaultFolder X. You can set a default folder per application with this app. Has a 30 day demo.
    http://www.stclairsoft.com/DefaultFolderX/
    Users with the small drives often put their iPhoto & iTunes Libraries on the external. You can then set the applications to look at the library on the external drive.
    Hope this helps!

  • How to save file on server folder

    hi
    i was trying to save file in my specify folder path.
    but it cann't save on than location.
    if i will not specify path then it directly save file on "c:program files\tomcat5.7\bin\mytextfile.txt"
    if i will specify perfect path "c://systemfile//mytextfile.txt"
    it saves on that location.
    if i will define path as ".//www//systemfile//mytextfile.txt"
    "//www//systemfile//mytextfile.txt"
    "//systemfile//mytextfile.txt"
    ".//mytextfile.txt" it cann't save file on location

    i know how to upload file .
    i need to save file on my web folder " /www/file/ xxxx.txt"
    how i will save it .over ther in my program i will specify location "c:/Program file/file/xxxxxx.txt"

  • 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

  • How to write file to server side?

    hello,
    Could anyone pls help me...
    I just want to see an example how can I write to a file that is placed at the server(save place as the applet).
    p.s. I have been successfully read a file from there...
    Suppose I have signed the applet (self-signed), anymore security problem I need to pay attention to?
    Thanks a lot!!

    hi mandy, from the applet u can send the file to be written into the server to a servlet running in server and the servlet can in turn write the file into the servlet. by applet - servlet communication, u can easily read and write files to the server.

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

  • Save file at server site

    hello !
    I want to save a gif file at the server, and when some button click, display it in html
    It's work well only if I save it at the local disk.
    Does anyone know how to do it ?
    thank...

    You have to have something running in the server that will do that for you. For example, you could write an upload servlet that you call to ask it to upload the GIF file for you.

  • Opening an excel file on server side using servlets

    hi, am having a small problem for launching an excel file. Standalone,
    i use
    Desktop.getDesktop().open( new File("C:/test.xls") );
    and it works fine but when using servlets via tomcat, it does not launch. Any idea?
    actually am using ajax to allow a user to remotely launch an excel
    file (the excel file contains a macro which will generate and save a
    chart as image) on the server.

    Do you realize that this will only open that Excel file at the Server machine, not at the Client machine? If you're testing (read: acting as Client) at the same machine as where the Server runs, then you will see the result of Desktop#open(). But if you're testing at a different machine (read: as in the real world) than where the Server runs, then you won't see the result of Desktop#open(), because this is executed at the Server machine itself, not at the Client machine.

  • How can automatic save file from apex to user local directory?

    how can save pdf file from apex to user local directory on button click?

    >
    Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "940509".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    how can save pdf file from apex to user local directory on button click?As Tony points out the ability to do so would represent a major security breach. The normal approach is to present the user with a download link that when clicked prompts them with a Save dialog in which they can select a location for the downloaded file.
    What is the source of the PDF file?

Maybe you are looking for

  • How do i know if my pc is infected by a backdoor virus?

    how do i know if my pc is infected by a backdoor virus?.... there was a window, which said that i won something.... the only button was the "ok" button, to go on.....there was no red X on the upper side left and i could not even close safari..... so

  • Third Party sale error

    Dear Gurus, The below error does not allow me to save the P.Order. I am configuring the standard third party sales schenario where the Item category is TAS and Schedule Line Cate. used  is CS. The material type I used is Trading Goods. I created a sa

  • Dock finder issue

    Hello everyone Hoping I could get some help here recently I have noticed this happening more frequently. Using Dock to launch my applications will work fine but after a while I go to click the application to get back into the program and clicking the

  • RPC Connect Failed

    Hi, I am getting the following error in my application where in making RPC calls via RemoteObject. [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: St

  • Too many fields (QE 3018) [Message 300 - 19]

    Hi, I've the error mentionned in the object when I try to do different operations like changing language or setting up email address for any user... can  somehone help me ? Franck