Open/save doc file

Hi,
in jsp I need to proviede a link like
download
a) does this really need a server side coding.
b) what i thought is to provide the path like 'http://www.some.com/filename.doc' so that an html code will do the needfull... will this work??
It would be great if someone can post me code...
thanks
sj

It would work if some.doc is in the same folder as the page thats trying to access it, to make this easier, i suggest you include the complete address, especially if its a static resource. Theres no need for server side code, the users browser takes care of everything, by sending a http request, and the server retrieves the resource.

Similar Messages

  • Pages v4.0 (727) can't open or save .doc files

    Hello everyone,
    for a while now I haven't been able to open or save .doc files with Pages. When trying to open a .doc file I get the following message:
    "The document "example.doc” couldn’t be opened."
    I have tried the following to solve the problem:
    1. run Software Update, which told me there were no updates available
    2. checked my applications folder to see if Pages was in the iWork '09 folder in order for SU to be able to detect updates (it was)
    3. reinstalled Pages from the iWork disc and run SU (which again couldn't detect any updates)
    4. deleted the com.apple.iWork.Pages.plist file from the Preferences folder in the user library on the Macintosh HD
    I'd be very grateful if someone could point me towards a solution, I've spent an age on google looking for one and haven't found anything useful so far.
    Thanks in advance
    XtremeFlux

    Are you still on MacOs 10.6.1? You should update it to 10.6.8. Use the Combo update here if the Software Update check doesn't work (which it should) http://support.apple.com/kb/DL1399
    And here you can find the iWork 09 updates. Software Updates should find them!
    iWork 9.0.4
    iLife Support 9.0.4
    You need both.

  • How to open a ".doc" file with ms word directly with this servlet?

    Here is a servlet for opening a word or a excel or a powerpoint or a pdf file,but I don't want the "file download" dialog appear,eg:when i using this servlet to open a word file,i want open the ".doc" file with ms word directly,not in IE or save.
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class OpenWord extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    doPost(request,response);
    public void doPost(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException {
    String strFileName = req.getParameter("filename");
    int len = 0;
    String strFileType1 = "application/msword";
    String strFileType2 = "application/vnd.ms-excel";
    String strFileType3 = "application/vnd.ms-powerpoint";
    String strFileType4 = "application/pdf";
    String strFileType = "";
    if(strFileName != null) {
         len = strFileName.length();
         if(strFileName.substring(len-3,len).equalsIgnoreCase("doc")) {
              strFileType = strFileType1;
         } else if(strFileName.substring(len-3,len).equalsIgnoreCase("xls")) {
              strFileType = strFileType2;
         } else if(strFileName.substring(len-3,len).equalsIgnoreCase("ppt")) {
              strFileType = strFileType3;
         } else if(strFileName.substring(len-3,len).equalsIgnoreCase("pdf")) {
              strFileType = strFileType4;
         } else {
              strFileType = strFileType1;
    if(strFileName != null) {
         ServletOutputStream out = res.getOutputStream();
         res.setContentType(strFileType); // MIME type for word doc
    //if uncomment below sentence,the "file download" dialog will appear twice.
         //res.setHeader("Content-disposition","attachment;filename="+strFileName);
         BufferedInputStream bis = null;
         BufferedOutputStream bos = null;
         String path = "d:\\"; //put a word or a excel file here,eg a.doc
         try {
         File f = new File(path.concat(strFileName));
         FileInputStream fis = new FileInputStream(f);
         bis = new BufferedInputStream(fis);
         bos = new BufferedOutputStream(out);
         byte[] buff = new byte[2048];
         int bytesRead;
         while(-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
         bos.write(buff, 0, bytesRead);
         } catch(NullPointerException e) {
         System.out.println ( "NullPointerException." );
         throw e;
         } catch(FileNotFoundException e) {
         System.out.println ( "FileNotFoundException." );
         throw e;
         } catch(final IOException e) {
         System.out.println ( "IOException." );
         throw e;
         } finally {
         if (bis != null)
         bis.close();
         if (bos != null)
         bos.close();

    Hello!
    Does some one of you had open a MS word file (.doc) in Java search for a token like [aToken] replace it with another text and then feed it to a stream of save it?
    I want to build a servlet to open a well formatted and rich on media (images) ms word document search for tokens and replace them with information form a web form.
    Any Ideas?
    Thank you in advanced.

  • How to open a doc file using jsp Anchor tag

    when i am trying to open a doc file using a jsp it is opening with out proper alignment.
              how to open a doc file with proper alignment using Anchor Tag in JSp Page
              

    Hello!
    Does some one of you had open a MS word file (.doc) in Java search for a token like [aToken] replace it with another text and then feed it to a stream of save it?
    I want to build a servlet to open a well formatted and rich on media (images) ms word document search for tokens and replace them with information form a web form.
    Any Ideas?
    Thank you in advanced.

  • Open / save .mp2 files in Audition CS5.5? [Not .mp3]

    Anyone know how to open / save .mp2 files in Audition CS5.5? [Not .mp3]

    Wild_Duck wrote:
    a) costly for Adobe to implement
    To make the CS5.5 deadline, and with the cross-platform rewrite, we simply weren't able to get to some things on our list (not that we ditched the features or anything).   However, MPEG 1 Layer II, and MPEG 2 Layer II have their own royalty issues that we have to pay for.
    Wild_Duck wrote:b) they thought not many people needed it.
    Not the case at all, we know many of our loyal radio customers need this functionality on a daily basis.   I do, however, have to admit that we saw this as less prevelant than .mp3 (when looking at our total customer base).
    Wild_Duck wrote:
    I keep meaning to make a list of things that use mp2 like radio playout systems, the Nagra field recorder, DAB files and so on so as to make more of a case. Any examples of mp2 need should be flagged up to Adobe.
    Best thing to do would be to amass a set of test files such that if/when we support this, it can be more thoroughly tested in-house before we put it out the door.   I have a good set from various places, but we always get our best and trickiest test files from customers.

  • Problem in opening a doc file using Runtime.exec()

    Code:
    import java.io.*;
    class StreamGobbler extends Thread {
        InputStream is;
        String type;
        StreamGobbler(InputStream is, String type) {
            this.is = is;
            this.type = type;
        public void run() {
            try {
                InputStreamReader isr = new InputStreamReader(is);
                BufferedReader br = new BufferedReader(isr);
                String line=null;
                while ( (line = br.readLine()) != null) System.out.println(type + ">" + line);   
            catch (IOException ioe) {
                 ioe.printStackTrace(); 
    public class GoodWindowsExec {
        public static void main(String args[]) {
             String file = "test.doc";
             String appPath = "/C";
            try {
                String osName = System.getProperty("os.name" );
                System.out.println("OS : " + osName);
                String[] cmd = new String[3];
                if( osName.equals( "Windows NT" ) || osName.equals( "Windows XP" )) {
                    cmd[0] = "cmd.exe" ;
                    cmd[1] = appPath;
                    cmd[2] = file;
                else if( osName.equals( "Windows 95" ) ) {
                    cmd[0] = "command.com" ;
                    cmd[1] = appPath;
                    cmd[2] = file;
                Runtime rt = Runtime.getRuntime();
                System.out.println("Execing " + cmd[0] + " " + cmd[1] + " " + cmd[2]);
                Process proc = rt.exec(cmd);
                // any error message?
                StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR");           
                // any output?
                StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT");
                // kick them off
                errorGobbler.start();
                outputGobbler.start();
                // any error???
                int exitVal = proc.waitFor();
                System.out.println("ExitValue: " + exitVal);       
            catch (Throwable t) {
                t.printStackTrace();
    }I got this code from internet. Program will work fine if my "test.doc" is in "C:\test.doc" directory. Is there any way to get the application path and open the doc file or how to give a specified path for my doc file
    EG:- "C:\TestDir\test.doc"
    Thanks

    Well /C is not the path to the app. It is a switch to
    the command line.
    set your file name to "C:/test.doc"
    ~TimSorry, I guess my reply doesn't really answer the problem. But you can supply the entire path as part of the file name string.
    String file = "C:/Path/To/My/File/to execute/test.doc"

  • I recently updated my OS to OS X. I had to update my word and powerpoint etc... to 2011 version, but now when I want to open a .doc file made in word 2003 it removes all the text in it! I did not back anything up!

    I recently updated my OS to OS X. I had to update my word and powerpoint etc... to 2011 version, but now when I want to open a .doc file made in word 2003 it removes all the text in it! I did not back anything up! All my mums work is on there for her job and now she cant use it! I need help fast!

    If you updated from 2003 that must be on a Windows machine, can you recover them from there?

  • Firefox keeps aksing me what programs that i want to open a doc.file with every time i try to download a doc file.

    the program that I use is open office. I chekced the box that says that this will always open a doc file but it keeps asking me about it.

    Firefox should be able to remember your preference -- as long as the site is specifically identifying the file as a distinct content type. Some sites may fail to do this and simply indicate it is a binary file that the browser can't handle, in which case Firefox doesn't store a specific preference.
    So this could be a problem caused by how the server is identifying the content type. Or it could be a problem with the settings file that stores download preferences. The workaround for that problem is to remove the file and have Firefox rebuild it. If you have changed settings from the default (for example, how to view PDFs) you will have to change those settings again.
    If you want to try it:
    Open your current Firefox settings (AKA Firefox profile) folder using
    Help > Troubleshooting Information > (in the first table) "Show in Finder" button
    Leaving that window open, switch back to Firefox and Exit/Quit
    Pause while Firefox finishes its cleanup, then rename '''mimeTypes.rdf''' to something like mimeTypes.old
    Restart Firefox and see whether its memory improves.

  • Warning when opening a .doc file (with Pages) ruins my applescript convert process

    I have 2000 plus documents (some Pages, most .doc) that I need to convert to PDF. I've got a working applescript droplet that converts both doc and pages files very nicely... but on some of the .doc files I get this dialog: "Some warnings occured. Would you like to review them now."  This of course, ruins my script run.
    Is there a way to suppress this warning when Pages opens a .doc file?

    Only if there is a script for dialog boxes in your AppleScript which you would have to tailor for the responses.
    You can record snippets of mouse activity using the Script Editor and include those in your script if there are no AppleScript library items.
    Peter

  • Cannot open transferred .doc files on my BB Curve 8520

    I am a new user and have just bought a BB Curve 8520. Carrier is Virgin Media; OS is V4.6.1.314 (platform 4.2.0.135); Desktop Manager Version is 5.0.1.2.8
    I have transferred photos, music and some documents from my PC successfully to my BB using Desktop Manager. However some .doc files transfer, but I cannot open them on the BB. I get an error message saying a file cannot be opened as it is an RTF file. I also notice that when I start to transfer the files, the little window that pops up does not give me the option to convert them - it is grayed out. Help please - I am totally new to Blackberry and not a whiz! Thanks in advance!
    Solved!
    Go to Solution.

    You should save the files as true Word documents on your PC first.
    WordToGo on your BlackBerry will open MS Word documents.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How to open a .DOC file with MS-Word ?

    Hye fellow Java freaks,
    I have made an application to upload .DOC and .RTF files to the server using servlets and the Jakarta Commons FileUpload package.
    The files are uploading successfully.
    Now, I want to place a link to the most recently uploaded file and then, on clicking that link, I want the file to open not in the browser, rather with MS-Word.
    What is the servlet code that I should implement to accomplish this ?
    Any suggesions ?
    Thanx in advance.

    I think this is a client-side issue - how the browser chooses to deal with the .doc file it receives.
    You can 'save as' and then open the file by hand.
    --Jon                                                                                                                                                                                                                                                                                                                               

  • Opening a .doc file in Pages results in Untitled document?

    Hi all!
    I've reinstalled iWork '06, along with the rest of my OS, and I've noticed something strange: if I set Pages as default to open .doc files, every time I double-click on a .doc file, Pages opens it in an Untitled document.
    Of course, when it comes to saving changes, Pages asks me to save them in the Untitled, not in the original document. No matter that I exported the file in .doc in Pages in the first place, it just doesn't save it.
    How come?

    Before Pages 3/iWork '08, Pages opened any "foreign" document (Word, AppleWorks, text, RTF) as an untitled Pages document, just as it does a template. When you export a document, you're doing just that, not saving it. Pages "knows" you haven't saved it as a Pages document so the title doesn't change until you do save it.
    Since Pages 3, a "foreign" document will have the name of the original with the .pages extension added. But the rest of the process is the same.

  • Where do I save .doc file on an ipad

    I understand that by using pages app that I can open and modify a microsoft word document. But how and where can I save the file as .doc file????

    Hi
    I have been using Pages Only on my iPad, but need to save files as .doc regularly... Whenever I want to make a .doc file I use the "Save As . . ." option and choose .doc in the format box.
    The document itself is kept with my other Pages documents, which I believe may be what you originally asked.
    As far as I can tell, on the iPad there is no way to "organize" them, like there is on the iMac or other desktop/laptop. As far as my understanding, the iPad was not intended to be a full laptop - but maybe that has changed as they have added more functionality to the iPad 2.
    You can, as others mentioned, email the .doc files to anyone you choose from within Pages.
    I hope this helps

  • Unable to open skydrive docs files with Lumia

    Hello, I can open  doc files from skydrive with PC and browser, but not with Lumia phone office application. There is text : "there were some problems opening this file, some part may be missing. You may correct the problem opening and fixing the problem with PC"  I opened original and skydrive saved files. They were working normally with Openoffice or with browser but not with lumia. Thank you for your help. 
    Solved!
    Go to Solution.

    OpenOffice is known to not write fully Office compliant files. It may well be that is you open in Office and then save as a new file it will load up fine.   OpenOffice != Office and do not let them make you believe it is !
    Click on the blue Star Icon below if my advice has helped you or press the 'Accept As Solution' link if I solved your problem..

  • Open a .doc file

    Just got a new iMac (Lion). I have older .doc files that it appears I can read and edit and save and print. I don't need the Microsoft word program for this. But for incoming .doc files sent via email, for instance, cannot be read.  Do I need to purchase Microsoft Word to open them? Does the Apple Pages program allow me to open .doc files?
    Thanks.

    Pages, OpenOffice, and similar programs will open them. There's a trial version of Pages available on Apple's site.
    (61300)

Maybe you are looking for

  • ITunes Vista 64 bit --- display errors

    I have recently run into a problem with iTunes 8.2 for Vista 64 bit. When the window is not maximized, or close to taking up my entire screen, podcast and album covers, icons for the 'GET" for podcast, the icons for closing/max/min in the top right c

  • Proper video card to run a 23" display on a PC

    I am trying to set up a HP Media Center PC and G4 Mirror Door on a DVI KVM switch. My goal is to view the desktop of each on my 23" Cinema Display, but in order to do so I need a DVI video card that will push the widescreen format. Any recommendation

  • Has anyone had any success in correcting Maps mistakes?

    On multiple occasions I've submitted a correction using the function within Maps to report errors, but nothing is ever done.  Has anyone ever had any success in getting Apple's attention and getting something fixed?  Or is the submitting a correction

  • Starting a managed server session and keeping the session when you exit

    I created a managed server named "xxx_mgd" with the create managed server wizard in the admin console when I start the managed server it produces a prompt for the username and password, whcih is the same username and password entered when i was creat

  • IPhoto and PICASA

    I've been using the "export" function of iPhoto to upload pictures on my Picasa web albums...but since 2 days ago I get the following error message: "Unsupported output format: text/xml (status 400)". I didn't change a setting, or camera, so I don't