How to make a download from portlet?

Hi there!
How to do make a download in portlet. Standart methods don't work becouse Portal inserts it's headers first the file gets to a user.
What can I do?
Thanks in advance!

Check out the Portal Development Kit (PDK) available at http://portalstudio.oracle.com/
Hope this helps,
Rob

Similar Messages

  • Make files downloadable from outside tomcat(web) context

    Hi there,
    I made an application on whicht people can upload word/pdf files.
    I put them in a dir called /opt/customer/2342/ , where 2342 is the customer id.
    The files are stored there, because I don't want people to be able to just download the files by using http://www.blahblah.com/customer/2342
    Now I want to create a servlet or jsp file that is able to make the files downloadable for specific users.
    Of course I can find the files using java.util.File. But I don't have a clue how to make them downloadable from this path. Should it be something with a FileStream... ?? And adding the mime-type?
    Can anybody give me some hints on making files downloadable from a specific dir?
    Thanks in advance.
    Jeroen van Hertum

    here is a servlet that is used to load files that are stored on the file system. The user submits the file path releative to a know file path.
    package common.servlet;
    import java.io.*;
    import java.net.*;
    import javax.naming.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import org.apache.log4j.Logger;
    public class FileResourceServlet extends HttpServlet
        // -------- Static fields ----------------------------------------------
        // Logger
        private static Logger logger = Logger.getLogger(FileResourceServlet.class.getName());
         * Root context for all JNDI lookups
        private static final String ROOT_CONTEXT = "java:comp/env";
         * JNDI lookup name of the binary path value
        private static final String BINARY_PATH_KEY = "binaryPath";
         * Default in case looking it up from the environment fails
        private static final String DEFAULT_FILE_RESOURCE_PATH = "/home/cp/bin";
        // -------- Fields -----------------------------------------------------
        private String fileResourcePath = null;
        // -------- Methods ----------------------------------------------------
         * Initializes the servlet.
        public void init(ServletConfig config) throws ServletException
            super.init(config);
            try
                //Get Norm's info
                Context initCtx = new InitialContext();
                Context envCtx = (Context)initCtx.lookup(ROOT_CONTEXT);
                fileResourcePath = (String)envCtx.lookup(BINARY_PATH_KEY);         
            catch( Exception e )
                logger.error("Error looking up file resource path, going with " +
                             "default value - " + DEFAULT_FILE_RESOURCE_PATH, e);
                this.fileResourcePath = DEFAULT_FILE_RESOURCE_PATH;
            logger.debug("File Resource Path:" + fileResourcePath );
         * Destroys the servlet.
        public void destroy()
         * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
        protected void processRequest(HttpServletRequest request,
                                      HttpServletResponse resp)
                                      throws ServletException, IOException
            ServletContext sc = getServletContext();
            String pathInfo = request.getPathInfo();
            logger.debug("Path Info: " + pathInfo);
            if (pathInfo!=null && !pathInfo.startsWith("/")) pathInfo = "/" + pathInfo;
            String filename = fileResourcePath + pathInfo;       
            logger.debug("Binary Filename:" + filename );
            // Get the MIME type of the image
            String mimeType = sc.getMimeType(filename);
            if (mimeType == null)
                //sc.log("Could not get MIME type of " + filename);
                logger.warn("Could not get MIME type of " + filename);
                resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
                return;
            // Set content type
            resp.setContentType(mimeType);
            // Set content size
            File file = new File(filename);
            resp.setContentLength((int)file.length());
            // Open the file and output streams
            FileInputStream in = new FileInputStream(file);
            OutputStream out = resp.getOutputStream();
            // Copy the contents of the file to the output stream
            byte[] buf = new byte[2048];
            int count = 0;
            while ((count = in.read(buf)) >= 0)
                out.write(buf, 0, count);
            in.close();
            out.close();
         * Handles the HTTP <code>GET</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doGet(HttpServletRequest request,
                             HttpServletResponse response)
                             throws ServletException, IOException
            processRequest(request, response);
         * Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doPost(HttpServletRequest request,
                              HttpServletResponse response)
                              throws ServletException, IOException
            processRequest(request, response);
         * Returns a short description of the servlet.
        public String getServletInfo()
            return "Short description";
    }

  • How to make bootable iso from download

    how to make bootable iso from download

    This one - https://www.microsoft.com/en-us/download/details.aspx?id=5587
    1st:  This is NOT a .ISO file!!
    2nd.  It is a .MSI file which is a Microsoft Installer file.
    3rd:  Read the instructions:
    Install Instructions:
    Click the Download button to start the download.
    Do one of the following:
    To start the installation immediately, click Run.
    To save the download to your computer for installation at a later time, click
    Save.
    To cancel the installation, click Cancel.
    When installation completes a file called readme.txt will open to provide instructions for burning a home computer restore CD. The file is also located
    next to the ISO image file for later reference.
    4th: If you are unable to read and follow instructions, there is nothing anyone in these forums can do to assist you.  You must be capable of reading and following instructions! 
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
    OK, well sorry to disagree with you but:-
    1. Using windows 7, the download does not provide a save but only a run option.
    2. In the MS predownload instructions you copied it refers to the readme text next to "the ISO image"
    3. This is a copy of the read me file attached:-
    "This ReadMe document is one of the Windows Home Server Home Computer Restore CD files. Unless you changed the installation location during setup, the Home Computer Restore CD files and license terms are located in one of the following folders:
    * On Windows Vista: %HOMEPATH%\Documents\Windows Home Server Home Computer Restore CD (Dual Boot)
    * On Windows XP: %HOMEPATH%\My Documents\Windows Home Server Home Computer Restore CD (Dual Boot)
    To use the Home Computer Restore CD software, you must write the ISO image file (restorecd_dual.iso) to a blank CD. A CD/DVD burner is required to write
    the ISO image file to the CD. Usually a CD/DVD burner includes the software that you need to write ISO image files. Follow the instructions with your burner software, and then select the option to write an ISO image, not the option to write
    individual files. Note that you cannot write the ISO image by using Windows Explorer to copy the file to the CD-ROM drive.
    Burning the ISO image creates a bootable CD. To restore your home computer, boot the computer from the CD and follow the instructions.
    Microsoft may update the Windows Home Server Home Computer Restore CD software. You can download the latest version from the Microsoft Web site at http://go.microsoft.com/fwlink/?LinkID=109282.
    If you want to review the license terms for the Windows Home Server Home Computer Restore CD, the file EULA_DUAL.TXT can be found in the same folder"
    As you will see it refers to the downloaded .iso file. Nowhere is there a reference to a msi.  As there was only a run function on the downloaded file, it could not be saved. How is an ordinary Windows user meant to interpret the instructs
    if the download function does not work? What you do is try and follow the instructions and produce a load of frigging coffee mats, as it seems did many of the posters on this thread. Are we all illiterate?
    If Microsoft could think in the way of a user it would help a lot of people.
    So Rick Dee, please inform me how I misread the instructions?

  • How to remove available downloads from the list

    how to remove available downloads from the list without it resuming when i open itunes or check for available downloads?

    There is not a way to remove them from the list.  Just let them download, and then delete them from your library when they are done.

  • How can photos be downloaded from a SDHC card to an iPad Air?

    How can photos be downloaded from a SDHC card to an iPad Air?

    Apple also sells the Lightning to SD Card Camera Reader for US$29. No computer necessary - handy if you're out shooting important pics and want to check them on a larger screen right away.
    http://store.apple.com/us/product/MD822ZM/A/lightning-to-sd-card-camera-reader?f node=3a

  • How often does Mail download from a POP account?

    I'm trying to help a friend, but I'm not that Apple-savvy. I know in Windows mail clients, there are settings to adjust how often mail is downloaded from a POP server, but I couldn't find any such setting in my friend's MacBook mail application. He is running 10.4.11. Does it only download each time you launch the mail application or click the "Get Mail" button? Does it download on some pre-set schedule that can't be changed? Any help is appreciated. Thanks.

    "but I couldn't find any such setting in my friend's MacBook mail application."
    I believe the equivalent setting is:
    Mail>Preferences>General>*Check for new mail.*
    "Does it download on some pre-set schedule that can't be changed?"
    You can change the times for the +"Check for new mail"+ setting manually or use the computer setting.
    !http://i45.tinypic.com/jl0z95.jpg!

  • How to make a silhouette from a portrait (photo) and-

    How do I make a silhouette from a portrait?
    And how do I make the background transparent?

    Do you mean that I send you the portrait?
    Chabæna
    26 apr 2014 kl. 12:31 skrev c.pfaffenbichler <[email protected]>:
    Re: How to make a silhouette from a portrait (photo) and…
    created by c.pfaffenbichler in Photoshop General Discussion - View the full discussion
    How do I make a silhouette from a portrait?
    Ah, but wouldn’t it be ever so much easier to explain if you actually provided (a lores of) the image in question?
    And how do I make the background transparent?
    Preferably with a Layer Mask and then saving in the appropriate file format (psd or png24 for example support transparency).
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/6332417#6332417
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/6332417#6332417
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/6332417#6332417. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Photoshop General Discussion at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • How to make data flow from one application to other in BPEL.

    Hi All,
    I am designing work-flow of my application through BPEL(JDeveloper), I am making different BPEL projects for different functions, like sales manager got the order from sales person and sales manager either approve it or reject it, if he approve it it goes to Production manager and he ships the goods, now I want to keep sales person, sales manger,production manager in seperate BPEL files and want to get the output of sales person to sales manager and sales manager to production manager please help me in dong this.
    I was trying to make partner link in Sales manager of sales person and getting the input from there. I dont know this is right even or not, if it is right I dont know how to make data flow from one application to other.
    Experience people please guide.
    Sales Person -----> Sales Manager ----> Production Manager
    Thanks
    Yatan

    Yes you can do this.
    If you each integration point to be in different process, you have to create three BPEL process.
    1. Create a Async BPEL process 'A' which will be initiated when sales person creates the order.
    2. From BPEL process 'A' call a ASync BPEL process 'B' which has the approval flow. Depending on the input from process 'A' the sales manager will review the order in workflow and approve or reject and send the result back to process 'A'.
    3. Based on the result from workflow, invoke the Sync BPEL process 'C', where you can implement the shipping logic.
    -Ramana.

  • How to make one dvd from several camcoder dvd's

    How to make one dvd from several camcoder dvd's. I got a dvd camcoder, to be able to play them into DVD player I had to finalize  my disks. Now I got several DVD's whith short files and terrible custom camera menu. I'd like to make it more presentable.
    The main problem is I dont want to recode my vob files. So Final Cut and other editing soft is bad idea.
    Is there any soft on mac I could reauthor my DVD's?

    How to make one dvd from several camcoder dvd's. I got a dvd camcoder, to be able to play them into DVD player I had to finalize  my disks. Now I got several DVD's whith short files and terrible custom camera menu. I'd like to make it more presentable.
    The main problem is I dont want to recode my vob files. So Final Cut and other editing soft is bad idea.
    Is there any soft on mac I could reauthor my DVD's?

  • My message always comes from my iCloud @me handle and not my other IM accounts when I send an IM? How to make it come from my @gmail account?

    My message always comes from my iCloud @me handle and not my other IM accounts when I send an IM? How to make it come from my @gmail account?

    Hi,
    As you have found in the View Menu of iChat is the option to Display the Recipients Bar
    This bar when clicked will display the Screen Names that you know for your Buddy and your own Screen Names.
    The Buddy's names are in the "To:-" section whilst your own are in the "From:-"
    Example pic from my iChat 6
    The Chat window has to Be Open.
    The Buddy's current name becomes a Drop Down that show the To and From names.
    It appears to allow you to Connect Google or Jabber IDs to AIM Buddies but the tick will move to any valid Account if you change either the To choice or the From choice.
    AS you say about the add Buddy drop down that appears - when your Buddy list are displayed as one an extra drop down appears fro you to Select the account/list it is joining as a Buddy
    8:17 PM      Wednesday; January 4, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • HT1338 how can make a room from my start up disk in in mac pro

    how can make a room from my start up disk in in mac pro

    Only you can decide what you want to delete to free up space on your PB, Personally I think you'll find 17 GB won't go very far when you start to add video.
    Consider an external drive. Don't forget if you let your free space fall below 10% of the total size of the drive you will risk corrupting your directory structure or causing other damage which may result in a loss of data.

  • Hi, how to update my downloads from 128 to 256 kbits ?

    Hi, how to update my downloads from 128 to 256 kbits ?

    Al Tuco,
    You can do it with iTunes Match.
    See this document:  iTunes Store: iTunes Plus Frequently Asked Questions (FAQ)  and read the section on "Can I upgrade my previously purchased music to iTunes Plus?"

  • How can I see what, when and how much has been downloaded from the net?

    I use a satellite internet service which limits me to only 200Mb of downloads in a 24 hr period. Should I go over, I am "locked out" of my internet service for the next 24 hr period. Lately I have been locked out without thinking I have downloaded anything. I am wondering if there is a place on the computer I can look to give me an idea what has been downloaded and when? I did change the Apple software update to not "automatically update important files" but I am wondering are there any other programs or anything the system may be downloading automatically without me knowing and what can be done to rectify it?
    Thanks

    Thanks for the thoughts. Here is some more for consideration. I was locked out yesterday and when I finally got out of "lock up" today, I went to my satellite internet provider's site to see how much and when it was downloaded. I booted my machine at about 10 AM yesterday and according to their site between 10 and 11 AM I downloaded 188MB of data. Then from 11 AM to Noon they said I downloaded another 28MB which then resulted in my being locked out of the internet until noon today. During that time I was on the net, I initiated no downloading from any site nor did I have any video streaming. What is frustrating is I have no idea what is being downloaded or how much. Most other days of the week it appears that downloaded material is 75Mb or less and I can remember generating the downloads.Looking at their site, the "downloading" of mystery material begins quickly after booting the computer which leads me to believe, as Kappy was saying, this is likely something like Apple Software updater or such set to "Download on Startup". I guess I'm not quite sure how to check to see what is set to "Download on Startup" and how to make sure nothing downloads at startup unless approved by me. Any thoughts?

  • How to make "More Products" from Answers visible

    I am using OBIEE 10.3.4.2.
    I developed a solution that requires "Delivers". On my developers' box (Windows 7) everything is visible. Under "More Products", I see:
    Delivers
    BI Publisher
    Marketing
    Disconnected Analytics and
    Download Oracle BI for Microsoft Office.
    The moment I put my RPD and Catalog in System Test--which uses https:// and on a UNIX server, I can now only see:
    Download Oracle BI for Microsoft Office.
    which makes me suspect that their is a setting/configuration that is preventing me from seeing these products.
    Can someone tell me how to make these products visible? What settings do I need to change to make them visible?
    Thanks,
    "D"

    I shut the services both in SYS Test and my DEV box.
    Zipped the Catalog.
    Deleted all the old catalogs from my DEV box.
    unzipped the new Catalog
    started the services and I can see everything under " More Products"
    Shut down the services
    Moved back the Catalog to Sys Test
    And NO LUCK!!!
    I am beginning to think it is something to do with SSL
    "-D"

  • How to make a download page?

    Hi!
    I need to make a downloadable page out of a stream (or byte array - it doesn't matter) with a content of any type (e.g. a csv file or a binary file).
    I would like to make a link on a page which whould trigger an event. In the event handler I would prepare the needed data (generate, etc.) and let the client download it as a binary file (so that browser whould display a download page with options to open the file or save it).
    The problem is that I can't find out how to do that?
    Are there any how-tos or examples?
    Thanks!

    Well, a problem arised again when we moved our web application to the https protocol. DownloadPageRenderer didn't work at all with Internet Explorer browser, however other browser worked well and downloaded our file.
    I've made a separate servlet for simply returning a file from HttpSession in a doGet method, this is done by the following code:
    public class FileDownloadServlet extends HttpServlet  {
       * Process the HTTP doGet request.
      public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
        System.out.println("FileDownloadServlet.doGet() call in progress . . .");
        response.setContentType(contentType);
        response.setHeader("Content-Disposition", "attachment;filename=\"" + fileName + "\"");
        OutputStream os = response.getOutputStream();
        // save our data to the OutputStream...
        os.close();     
    }This code works well with Internet Explorer in our test server, Oracle9iAS/9.0.2. However this doesn't work with Internet Explorer on the client's server, Oracle9iAS/9.0.2.3.0.
    In our server (where it works), I get the following HTTP headers in IE (with ieHttpHeaders IE plugin):
    HTTP/1.1 200 OK
    Date: Tue, 31 Aug 2004 07:36:49 GMT
    Server: Oracle9iAS/9.0.2 Oracle HTTP Server
    Set-Cookie: JSESSIONID=<skipped>; Path=/
    Cache-Control: private
    Content-Disposition: attachment;filename="HTD Proov.htm"
    Keep-Alive: timeout=15, max=98
    Connection: Keep-Alive
    Transfer-Encoding: chunked
    Content-Type: text/html; charset=UTF-8On client's server (where it doesn't work):
    HTTP/1.1 200 OK
    Date: Tue, 31 Aug 2004 07:36:03 GMT
    Server: Oracle9iAS/9.0.2.3.0 Oracle HTTP Server
    Pragma: no-cache
    Cache-Control: no-store
    Surrogate-Control: no-store
    Expires: Sat, 11 Jul 1970 17:55:19 PST
    Set-Cookie: JSESSIONID=<skipped>; Path=/komm
    Cache-Control: private
    Content-Disposition: attachment;filename="proov.htm"
    Connection: close
    Transfer-Encoding: chunked
    Content-Type: text/html; charset=UTF-8Any ideas about how to make IE work with our application are welcomed. Can this be because of a wrong server configuration? Can any HTTP headers of the second response cause such behaviour in IE?
    Thanks,
    Alexey.

Maybe you are looking for

  • HT1766 Can I bypass my passcode?  I have a frozen screen.

    My iPhone 5 is frozen, I did the hard reboot and am trying to sync/back up on itunes but need to enter my passcode in order for the backup to take place.  Any ideas?  I am headed to the apple store shortly, but I am convinced there has to be an easy

  • Invalid characters when consuming web service

    Morning all, I am using Apache Axis 1.3 (yes, slightly old version) to consume a Microsoft SharePoint web service. The problem I am finding is that the returned XML contains an invalid XML character which is causing Axis to throw an exception. I have

  • Can I edit pdf files on a mac?

    I have Acrobat Reader on my MAC osx 10.6.8.  I need to edit an pdf document. I guess I need to buy an Acrobat software (Pro way too expensive and beyond what I need).  I tried to download the latest Acrobat Standard X package, but it does not seem co

  • How to view automator code?

    I've recorded an automator action in another application that supports Applescript (soundtrack pro). I'd now like to view automator's code so I can use it as part of a larger Applescript script. How can we view automator's code after recording? Thank

  • How to config to use SPFILE for databse

    Hi, As I want to setup recovery settings, OEM gave a warning: PFILE - The database is NOT using SPFILE. Changes to the initialization parameters will be LOST if the database is restarted. How do I config to use SPFILE for databse rather than using co