4 Replies Latest reply on Aug 17, 2006 5:45 AM by P P

    File download from CMS

    P P Newbie

      Hi, I've encountered a problem -- I have some files loaded to
      CMS. I want my portlet to allow downloading them.
      I'd like my portlet to display some kind of links and clicking on
      them would start the download of a file stored in CMS. I know how
      to get a file and its content from CMS, but I have no idea on how to
      let users download it.

        • 1. Re: File download from CMS
          Peter Johnson Master

          Handling this in the portal is pretty much the same as handling it for a regular web site. First, one of the HTML pages you uploaded to CMS needs to have links to the files you would like user to be able to download. Second, you have to be aware of the types of files being downloaded. If the file is HTML, it will appear in the CMS portlet. Other file types will appear in a separate window/tab (the Reference Guide provides details on this, rather than my looking it up to confirm what I just wrote I leave it to you to verify this). If the browser believes it can display the file, it will do so. If not, it will pop up the file download dialog box. Of course, the user can always right-click on any link and choose download. Knowing this browser behavior, I usually add "right-click to download" next to links for files the browser can display.

          • 2. Re: File download from CMS
            P P Newbie

            But I want to store the files in the CMS (not in any other filesystem). I'm not
            going to use the CMS portlet -- I'w writing my own. What I'm willing to do
            is display in my portlet something like link -- clicking on them would trigger the download from the CMS.
            I've read about using servlet in the same WAR archive where I have my portlet, but I don't know how exactly to do this. Any step-by-step instructions would be very helpful.

            • 3. Re: File download from CMS
              Peter Johnson Master

              I never said anything about how you store the files. My entire post assumed that the files were stored in CMS. Did you read the sections on CMS in both the User's Guide and the Reference Guide? They describe how URLs for binary files stored in CMS are constructed. Providing such a URL in your portlet display should be sufficient for doing a download - the user simply clicks on the link.

              • 4. Re: File download from CMS
                P P Newbie

                Thanks, it really helps a lot.