Problem with file download in oracle portal:UnsupportedEncodingException

Hi,
I'm developing a struts application inside Oracle Portal, when i click on a
action link i need to download a file.
<pdk-struts-html:link action="/fileDownload2Action?file=myfile.txt">Click Here to See the PDF</pdk-struts-html:link>
i've tried to use org.apache.struts.actions.DownloadAction as follows:
public class MyExampleFileDownload extends DownloadAction{
protected StreamInfo getStreamInfo(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
// File Name
String fileName = mapping.getParameter();
// Set the content disposition
response.setHeader("Content-disposition",
"attachment; filename=" + fileName);
// Download a "pdf" file - gets the file name from the
// Action Mapping's parameter
String contentType = "application/pdf";
File file = new File(fileName);
return new FileStreamInfo(contentType, file);
but on the forward i receive the following exception:
received IOException
java.io.UnsupportedEncodingException: Media Type of a TextResponseWrapper must start with "text/"
at oracle.webdb.provider.v2.utils.http.TextResponseWrapper.getData(Unknown Source)
at oracle.webdb.provider.v2.utils.http.TextResponseWrapper.getData(Unknown Source)
at oracle.portal.provider.v2.render.http.AbstractResourceRenderer.renderBody(Unknown Source)
at oracle.portal.provider.v2.render.RenderManager.render(Unknown Source)
at oracle.portal.provider.v2.DefaultPortletInstance.render(Unknown Source)
at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.showPortlet(Unknown Source)
at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.handleHttp(Unknown Source)
at sun.reflect.GeneratedMethodAccessor119.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at oracle.webdb.provider.v2.adapter.SOAPServlet.doHTTPCall(Unknown Source)
at oracle.webdb.provider.v2.adapter.SOAPServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:224)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:133)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
---end
so it seems that struts forward in oracle have to be only text/html files
but i don't wanto to go tio another page, just download a file on the same page
after some control in my action.
Could you suggest me any alternative solution?
Regards,
Francesco Rizzello

Hi,
Did this work ? :-
Struts Download action portlet:UnsupportedEncodingException
Regards,
Sandeep

Similar Messages

  • Having problems with corrupt downloads of Oracle 9i Release 2 Unix files

    So that we may better diagnose DOWNLOAD problems, please provide the following information.
    - Server name download-east.oracle.com
    - Filename server_9201_hpunix64_disk[1,2,3,4].cpio.gz
    - Date/Time 06/19/2002 and 06/20/2002 all day, even tried downloading late at night
    - Browser + Version tried IE 6.0, Netscape 6.2.3, Netscape 4.79
    - O/S + Version Windows 2000 and Windows XP Pro
    - Error Msg unable to read cpio file, it extracts part of the file but fails when it gets close to the end.

    Sorry did I mention that
    Opera on windows crashes when trying to download these files.
    Ie 6, just writes the files but the download obvioulsy errors out as the files are too small.
    Netscape actually raises and error message when the download stops.
    In any case there is no ftp access so that won't work and because of the stupid agree with the licence agreement when you try to reference the files directly you can't simply issue a command like wget -c oracle_cpiofile.gz.

  • Problem With File Download Dialog Box

    Hi all,
    I have jsp page that allows a user to export oracle data to excel.
    I have these code in my page:
    <%@ page contentType="application/vnd.ms-excel" %>
    response.setContentType ("application/vnd.ms-excel");
    response.setHeader ("Content Disposition",
    "filename=\"historicalrate.xls\"");
    I run the page and it popups a file download dialog box with Open and Save buttons.
    When I click the Save button a Save As window opens with a hr.xsl file name and Microsoft Excel Workbook(*.xls) as save type. It is what I want.
    The problem I have is when I click the Open button on the file download dialog box it displays data in excel format on a browser well. Then I click File > save as on browser's tool bar the Save As window pop up with no file name and a default Text(tab delimited)(*.txt).
    I need the file name and Microsoft Excel Workbook(*.xls) as default save type.
    Any help would be greatly appreciated.
    Please help
    Thanks

    I have the same problem with hui_ling.
    When user click on "Open", Excel start and open excel file correctly but the file name on excel title bar. 'Cause the file name is in Japanese characters. Any one can help me?
    Message was edited by:
    TNTVN

  • I am using Windows XP SP3, I have problem with file download while resuming downlod giving error "file...could not be saved, because the source file could not be read." Please help me

    I am using Fire Fox 5 beta version. After pausing the long file download, when I press the Resume download button the above message appear each time asking "Contact to Administrator". This problem was not with Fire Fox version 3 and above. Please Help Immediately. Thanks in advance...

    It is possible that your anti-virus software is corrupting the downloaded files or otherwise interfering with downloading files by Firefox.
    Try to disable the real-time (live) scanning of files in your anti-virus software temporarily to see if that makes downloading work.
    * http://kb.mozillazine.org/Unable_to_save_or_download_files

  • Problem with file download option in ALV via ITS. Please help!

    Hi Experts,
           I have a ALV report which I have web enabled using ITS service. In the ALV there is a delivered functionality for file download. It works fine when the report is run in the SE80. But when I run the ITS service for the report and choose file download option it displays a page saying "this page has been diaplayed due to technical reasons" with title "File properties". In addition it looks for Java runtime in the browser. After all this it opens a popup window for selecting path and file name.
    This is not user friendly and many customers have rasied their concerns on it.
    My question is that,
    Q1: What is the need of this "File properties page"? Why ITS calls this while ABAP editor does not?
    Q2: Is there any way we can suppress this so that it directly opens a popup window for selecting path and file name?
    Please help me.
    Thanks
    Gopal

    Hello Klaus,
    i have also the problem with these intermediate screens!
    We have in between installed patch 22 for ITS 6.20 and SP18 at SAP Netweaver 2004!
    But they are still not processed invisible for the users.
    Are there any additional parameters, which controls this behaviour(~webgui_updown_make_visible is not used!)?
    How can i check, if i have really a.ex. the actual ws.jar-file or other related files of the patch?
    We are using the standalone ITS with an own (modified) IAC with an own CI-design for the webpages. The intermediate screens are displayed with the "normal" SAPGUI-design because of the parameter ~generatedynpro. Without this it does not work, because the template SAPLSIT_0100 is missing!
    Or do you have an example for such a intermediate template with the applet for an upload of a file?
    Thanks in advance
    Felix

  • Problem with File download in ALV via ITS. Please help!

    Hi Experts,
           I have a ALV report which I have web enabled using ITS service. In the ALV there is a delivered functionality for file download. It works fine when the report is run in the SE80. But when I run the ITS service for the report and choose file download option it displays a page saying "this page has been diaplayed due to technical reasons" with title "File properties". In addition it looks for Java runtime in the browser. After all this it opens a popup window for selecting path and file name.
    This is not user friendly and many customers have rasied their concerns on it.
    My question is that,
    Q1: What is the need of this "File properties page"? Why ITS calls this while ABAP editor does not?
    Q2: Is there any way we can suppress this so that it directly opens a popup window for selecting path and file name?
    Please help me.
    Thanks
    Gopal

    Hello Klaus,
    i have also the problem with these intermediate screens!
    We have in between installed patch 22 for ITS 6.20 and SP18 at SAP Netweaver 2004!
    But they are still not processed invisible for the users.
    Are there any additional parameters, which controls this behaviour(~webgui_updown_make_visible is not used!)?
    How can i check, if i have really a.ex. the actual ws.jar-file or other related files of the patch?
    We are using the standalone ITS with an own (modified) IAC with an own CI-design for the webpages. The intermediate screens are displayed with the "normal" SAPGUI-design because of the parameter ~generatedynpro. Without this it does not work, because the template SAPLSIT_0100 is missing!
    Or do you have an example for such a intermediate template with the applet for an upload of a file?
    Thanks in advance
    Felix

  • Problem with FIle DownLoad

    Hi All,
    I am working on project where I need to display all the files (on the UI screen)which are in  windows folder with a download link.
    I used IWDDownload UI element for  downloading the file. Its working fine but problem is , when ever I download a file for first time its working fine. Later what ever I download other files, I was able to see only first file download. I guess this is problem with context binding but I am not sure.
    I used for loop to iterate all the files in folder and I binded the file name to IWD Download UI element using bindText option.I am creating UI elements dynamically in wdDoModifyView and it will call another method to bind to context.(As SAP Suggested not to modify any context elements in wdDoModifyView method).
    Please help me in this regard.
    Ramesh

    Ramesh,
    You need N dynamic binary attributes or IWDResource (in newer versions), one per file. Create them either in wdDoInit of view or in some suitable action handler.
    Then you have to populate IWDResource or set bytes of binary attributes. Check corresponding WD tutorials how to do this.
    In wdDoModifyView create IWDFileDownload control per every attribute and bind either "data" property (to binary attribute) or "resource".
    Valery Silaev

  • Problem with file downloads - please help

    Good morning. Since upgrading to BT Infinity 2, I have been experiencing the following problems:
    Cannot update Sonos firmware to version 5 - download times out and gives error 30
    Cannot download most files from safari - all start for the first few kb and then just hang
    Cannot download larger PDF files from Mac Mail
    These problems manifest themselves over wireless and wired connections, with the BT Homehub 5 and an Asus router. My ipad has no problems when on other networks or if I access my email from my work computer. When talking to BT technical support over the chat facility yesterday the connection dropped once every 10-30 seconds before reconnecting again. All of this leads me to believe that I have an intermittent failure on my broadband connection however BT insist that there is nothing wrong with the line or the router. I have changed channels on my router but this does not seem to make things better. Internet is working fine on all my devices for web browsing - only file downloads experiencing problems.
    Please help.

    Oh sorry, I thought from your description you were using an ASUS connected to the HH5, but it turns out you're using them separately.
    Is there a firmware update you can get on the ASUS?
    If you found this post helpful, please click on the star on the left
    If not, I'll try again

  • Problems with Macromedia Extension for Oracle Portal

    Hello,
    I’m learning about Oracle portal 10g(3.0.4). I'm having some problems about Oracle portal. Please help me as soon as possible.
    I created an Web Template using Dreamweaver MX 2004, and I´m tring to send this template to Oracle Portal through dreamweaver webservice (dreamweaver_webservice.zip) using Dreamweaver extension (dreamweaver_extension.zip) but when I try to connect using the extension to send my template I get Invalid Login message (I tried all possible passwords and logins for Oracle Portal and OracleAS). Please Help!
    Please help me or give me any materials about oracle portal. I want to study about this subject so if you have books in pdf format please send me.
    [email protected]
    thanks
    Douglas

    When I try to open the url with the ORMI port in the brownser I get this error message:
    Invalid protocol verification, illegal ORMI request or request performed with an incompatible version of this protocolvInvalid protocol verification, illegal ORMI request or request performed with an incompatible version of this protocol
    Ports I have tryed : 1852 and 3202
    ex:
    http://<host>:<port>/portalTemplate/portalTemplate

  • Problem with file download through JSP under WLS6.1 SP3

    Hello,
    We're in the process of trying to migrate from WLS 6.1 SP1 to SP3, and we're encountering
    some difficulties with this migration.
    I'm attaching a very simple JSP here - it's a snippet from a larger more dynamic
    JSP, that I managed to narrow down to a pretty simple case which still doesn't
    work.
    This JSP opens a file residing at "c:\\BDELog.txt" (it's hardcoded - so change
    it to any textual local file on your machine in order to test it), and writes
    it to the output stream as a txt attachment.
    This JSP works perfectly well on SP1, however, on SP3, it fails only during the
    first hit. If you call this JSP again from the same browser window - it'll work.
    Needless to say - this isn't an acceptable behavior for a website.
    Hope you can help.
    Appreciate any response.
    Roy.
    [download.jsp]

    SP4 indeed solved it.
    Thanks again!
    Roy.
    "Eric Gross" <[email protected]> wrote:
    As a follow-up, SP4 is now available.
    Regards,
    Eric
    "Eric Gross" <[email protected]> wrote in message
    news:3dd19974$[email protected]..
    I would wait until SP4(I believe it may be coming out this week actually).
    If you can't wait until then, please contact support for a 1-off patch.
    Regards,
    Eric
    "Roy Abitbol" <[email protected]> wrote in message
    news:3dd10ef1$[email protected]..
    Many thanks !! (sigh of relief...)
    Is there a way to work around this problem - for example - write
    the
    header explicitly
    so that the problematic header will be overriden or simply get a
    patch
    from you
    guys ?
    Or do we have to wait for SP4 ?
    Thanks again,
    Roy.
    "Eric Gross" <[email protected]> wrote:
    This is a known issue and has been fixed.
    The fix is in SP4. This has to do with a bug that IE has with respect
    to a
    header:
    Cache-Control: no-cache="set-cookie"
    We introduced that as the default header to be returned on all
    responses.
    As of SP4(due out very soon), the default behaviour will be notto send
    this
    header back with each response.
    Regards,
    Eric
    "Roy Abitbol" <[email protected]> wrote in message
    news:3dca7f19$[email protected]..
    Hello,
    We're in the process of trying to migrate from WLS 6.1 SP1 to
    SP3,
    and
    we're encountering
    some difficulties with this migration.
    I'm attaching a very simple JSP here - it's a snippet from a largermore
    dynamic
    JSP, that I managed to narrow down to a pretty simple case which
    still
    doesn't
    work.
    This JSP opens a file residing at "c:\\BDELog.txt" (it's hardcoded- so
    change
    it to any textual local file on your machine in order to test
    it),
    and
    writes
    it to the output stream as a txt attachment.
    This JSP works perfectly well on SP1, however, on SP3, it fails
    only
    during the
    first hit. If you call this JSP again from the same browser window- it'll
    work.
    Needless to say - this isn't an acceptable behavior for a website.
    Hope you can help.
    Appreciate any response.
    Roy.

  • Problem with the nodes in Oracle Portal using JPDK Portlets

    Here in Production environment we have 2 different Portal Servers
    Even if logged in with the node 'b' then also the images path showing path from node 'a' only.
    Note:
    The thing is both the Portal servers are sharing the common portal repository.
    We are using JPDK Portlets with Oracle Appserver

    Does anyone know how to modify an existing report with sub labels within the main report? I am trying to resize one of the labels.
    O'Neil

  • Partial Submit problem with file download listener

    Hi All,
    I am exporting a table to PDF in my jspx page. For this i have written below code:-
    <af:commandImageLink id="cil6" icon="pdf.png"
    partialSubmit="true"
    >
    <af:fileDownloadActionListener contentType="application/pdf"
    filename="SumData"
    method="#{Sum.exportToPDF}"/>
    </af:commandImageLink>
    It is saving the pdf at a desired location. But as i have made my COMMAND LINK is not executing partial submit behaviour inspite that i have made it partialSubmit="true" .
    After downloading pdf when i click anyother button i get an alert saying...DO YOU WANT TO RESEND THE INFORMATION TO SERVER?
    I don't want this behaviour but i am unable to debug this. Please help.

    Hi,
    afaik.. fileDownloadActionListener does a post to server..even if you do partialSubmit to command component
    After downloading pdf when i click anyother button i get an alert saying...DO YOU WANT TO RESEND THE INFORMATION TO SERVER?I guess you might not have enabled partialSubmit on the other button..
    Try these options, in your web.xml set following in context initialization parameters section
    org.apache.myfaces.trinidad.PPR_OPTIMIZATION                  on
    oracle.adf.view.rich.pprNavigation.OPTIONS                          onRegards.

  • Problem in File Download

    In some thread, i had this problem with file download that instead of opening File Save..popup, the contents of file on the server were being rendered statically as HTML. I have figured out the solution to that but now the thing is in every file, there are some \n\r being added in the beginning of the file. Can anybody help. Here's is my code.
    <%@ page import="java.io.*"%>
    <%
         try
              response.setContentType("APPLICATION/OCTET-STREAM");
              String strProjectInfoPageHeader = "Attachment;Filename=\"" + request.getParameter("txtProjectInfoPageFileName") + "\"";
              response.setHeader("Content-Disposition", strProjectInfoPageHeader);
              File fileToDownloadProjectInfoPage = new File(request.getParameter("txtProjectInfoPageFilePath"));
              FileInputStream fileInputStreamProjectInfoPage = new FileInputStream(fileToDownloadProjectInfoPage);
              int varProjectInfoPage;
              while ( (varProjectInfoPage=fileInputStreamProjectInfoPage.read()) != -1 )
                   out.write(varProjectInfoPage);
              out.flush();
              out.close();
              fileInputStreamProjectInfoPage.close();
         catch(Exception e)
              out.println(e);
    %>Thanks and regards
    Vikram

    JSPs will invariably have newlines and whitespace in them, even if you don't explicitly put them. Instead of wasting time trying to fix it, just move your code to a servlet and map it to the same path. That's the fastest and most sensible solution. It also follows the convention that JSPs are to be used for display only and servlets for processing.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://www.catb.org/~esr/faqs/smart-questions.html
    ----------------------------------------------------------------

  • Unable to download from AppStore, updates,etc.Messages 'the installer is damaged' to 'there might be a problem with file ownership and permissions.' I am the owner and only user of a new MBP. What could be going on?

    Is anyone having the same type of problems I'm having with Lion. I have a new MacBook Pro, received 7 weeks ago, preinstalled with Leopard 10.6.7. I didn't migrate anything from my old iMac, wanted a clean install from the Apple Store. While there, I asked for the upgrade to Lion 10.7, however their system was down.
    I  installed it myself, wirelessly about a week later, and Apple emailed me a receipt. Now, I've had to call support directly last week when I lost Mail, Address Book, was unable to open Preview or iTunes, among other problems. Seemed fixed after a session that baffled even the store tech.  Now I am unable to download or install the recent Mac updates for Lion, from the App Store, could not install Adobe Reader, etc. Messages range from 'A network error has occured - Check your Internet connection and try again' to 'The Installer is damaged and cannot open the package. There may be a problem with file ownership or permissions.'  All fail and I'll probably have to call Apple again. I am frustrated beyond words.  Logs 'Install's runner tool is not properly configured as a setuid tool', domain errors, 'attempt to write a readonly database, and on and on. I have barely done a thing on this computer except search online for help with these problems. Safari gives me a 'You are not connected to the internet' too often. Diagnostics disagrees. I do see wi-fi problems in the forum. Disk and permissions were fine at the beginning of the earlier problems, checked first by support tech. I'm not sure if support tech even knew. I was just happy they were fixed. Anyone have these download and/or install problems after a 'clean bill of health' so to speak, only a week ago?

    Let's try the following user tip with that one:
    "There is a problem with this Windows Installer package ..." error messages when installing iTunes for Windows

  • This message [Ubuntu repositories or Mozilla download: " There is no Profile folder Could not initialize the application's security component. The most likely cause is problems with files in your application's profile directory....

    Ubuntu 11.04: I have been getting this message whenever I install Firefox from the repositories and downloading the tar file. I cannot use Firefox! " There is no Profile folder Could not initialize the application's security component. The most likely cause is problems with files in your application's profile directory. Please check that this directory has no read/write restrictions and your hard disk is not full or close to full. It is recommended that you exit the application and fix the problem. If you continue to use this session, you might see incorrect application behaviour when accessing security features."Firefox does not respond to any addresses or a google search. Indeed it responds to nothing. There is no Profile folder!

    Uninstalling Firefox on Linux
    * http://kb.mozillazine.org/Uninstalling_Firefox#On_Linux
    * http://kb.mozillazine.org/Installation_directory#Linux
    * Removing user profile data - http://kb.mozillazine.org/Uninstalling_Firefox#Removing_user_profile_data
    After all is done, Restart your system.
    Installing Firefox on Linux
    * https://support.mozilla.com/en-US/kb/Installing%20Firefox%20on%20Linux
    Check and tell if its working.

Maybe you are looking for