FIle download not working in page fragment

Hi All,
I have to download a file . I am using Dynamic tab shell and in one pf my page fragement link to download a file is avaliable...
I did a POC on jspx and its working fine but when i try to use the same code in my jsff (page frament ) its not working any idea that do i have to do anything specific to acheive the same..
Thanks
Shubhangi

Shubhangi/Timo,
was this resolved? I am having the same issue. File download works fine in a jspx page but the same code is not working when file download is used as part of a page fragment.
I have a table column that has the filename as commandlink with a managed bean code as below.
public oracle.binding.BindingContainer getBindings() {
return BindingContext.getCurrent().getCurrentBindingsEntry();
public void downloadFile(ActionEvent actionEvent) {
FacesContext fctx = FacesContext.getCurrentInstance();
// myDocumentLocation specified in web.xml
String DOCUMENTS_LOCATION =
fctx.getExternalContext().getInitParameter("myDocumentLocation");
if (DOCUMENTS_LOCATION == null) {
// DOCUMENTS_LOCATION = "C:\\Documents and Settings\\xxloc\\";
Application app = fctx.getApplication();
ExpressionFactory elFactory = app.getExpressionFactory();
ELContext elContext = fctx.getELContext();
ValueExpression valueExp =
elFactory.createValueExpression(elContext, "#{row.OrderFileName}",
Object.class);
String s1 = (String)valueExp.getValue(elContext);
System.out.println(s1);
String filename = s1 ;
File srcdoc =
new File(DOCUMENTS_LOCATION + filename);
if (srcdoc.exists()) {
FileInputStream fis;
System.out.println("exists");
byte[] b;
HttpServletResponse response =
(HttpServletResponse)fctx.getExternalContext().getResponse();
response.setContentType("application/x-download");
response.setHeader("Content-Disposition",
"attachment; filename=" + filename);
response.setBufferSize(1024);
// response.setContentLength((new Long(srcdoc.length())).intValue());
OutputStream out = null;
try {
out = response.getOutputStream();
} catch (IOException e) {
e.printStackTrace();
try {
fis = new FileInputStream(srcdoc);
int n;
n = fis.available();
while (n > 0) {
b = new byte[n];
System.out.println("b" +b);
int result = fis.read(b);
out.write(b, 0, b.length);
if (result == -1)
break;
} catch (IOException e) {
System.out.println("in file error");
e.printStackTrace();
try {
out.flush();
out.close();
} catch (IOException e) {
e.printStackTrace();
fctx.responseComplete();
It would be great if someone could guide me with this issue.
Thanks,
RAS

Similar Messages

  • File downloads not working in Pepper-Flash beta 11.8.800.115 (chrome)

    Pepper-Flash Beta version 11.8.800.115 was auto-installed in latest Chrome update (29.0.1547.57 m).  This flash version does not display save/open dialog when clicking on a link that opens a file via flash.net.navigateToURL(request, "_self").  Request is an http get that calls a servlet that responds with a binary stream.

    The follow are two separate workarounds that we used.  We initially used the first workaround below until figuring out #2.
    (1) Use the download function on a flash.net.FileReference object.  The flow is not as nice, but works as long as the download occurs as part of a user initiated event, such as a button click.  We added a switch so that this workaround was only used if the browser was Chrome, so that IE and Firefox kept the same flow.
    (2) Embed a hidden frame in your html and make an ExternalInterface call similar to the following to target the download to it.  We also have an exit page prompt, but targeting a hidden frame does not affect it:
    ExternalInterface.call("downloadFileToHiddenFrame", url);
    Javascript function...
    function downloadFileToHiddenFrame(locationRef) {
        top.frames["myhiddenframename"].location.href = locationRef;
    One note, we always use application/octet-stream as the mime type for downloads to avoid the possibility of the file actually rendering in the hidden frame.  After implementing #2 above, file downloads in Chrome now flow exactly the same as before the pepper flash issue surfaced.
    Hope this helps.

  • File Download not working for anchor tags

    Hello,
    I've encountered a bug with the 4.1.31 version of Tomcat. Apparently, when
    I use an anchor tag for a file, and I click on the link, it does not show the
    file download message "Do you want to open or save this file?" with the open
    and save options. Instead, it displays the file in the browser. I know you
    could normally save this information from the browser to a file, but I need it
    to show the download message because it's easier for users to save their
    file. I'm using Internet Explorer version 6, SP2. I've also tried setting
    the "Confirm open after download" check box for file types to no avail. It
    use to work in Tomcat 4.1.18.
    Any help would be appreciated.

    Can anyone pls. help me ? I tried all options from disbling firewall to uninstalling Bonjour.. But nothing works. Had I known that Apple makes such worst software I would never have bought iPhone !!!! Apple really *****!!!!!!!

  • File downloads not working most of the time

    [I originally included this problem in another post; I should know better. I'm posting it separately here in hopes of getting some feedback about this other issue I'm having.]
    When I click on a link on a Web page to download a file (maybe the latest version of Firefox), the Save dialog that appears almost always displays the file name without the extension. For example, I just tried downloading the Firefox installer. Instead of displaying the name as "Firefox Setup 13.0.1.exe", it displayed "Firefox Setup 13.0.1". The file type is listed as "binary file". Every once in a while (maybe one in ten tries), if I quit and relaunch Firefox, immediately return to the download page, and click the file link again, the file name and file type will appear correctly. Almost always, I have to resort to using some other browser to download the file.
    I've tried deleting the browser cache; resetting Firefox from the about:support page; installing a new copy by downloading the installer file from the Mozilla site. None of this has helped.
    The thing that mystifies me the most is the fact that, maybe 10% of the time, the file download succeeds. This (the file download succeeding) seems to happen only immediately after I launch the browser.
    Any ideas?
    --Larry

    Thanks for the suggestion. I followed the instructions and deleted the MimeTypes.rdf file, then relaunched Firefox. Unfortunately, nothing changed.
    I did notice something strange and possibly informative, however: When I tried to download the Firefox installer, the file once again failed to download. The Downloads window that pops up when I download a file gave the full file name, including the ".exe", and displayed "Canceled - mozilla.net". It appears that the file type isn't lost after all, but the download is canceled.
    Any idea what could cause this?
    --Larry

  • Download not working: requested page not found

    see the subject

    From index software page:
    Important Note: As of 2:30pm PT Sept. 18, OTN software downloads are currently unavailable. We apologize for any inconvenience and are working to restore them as quickly as we can.

  • PS CS3 not recognizing Raw Files and converters Ive downloaded not working..Why not?

    PS CS3 not recognizing Raw Files and converters Ive downloaded not working..Why not?

    Do you seriously think we can answer that with zero information from you?
    Please give us:
    Operating System/version
    Photoshop version number
    Amount of RAM installed
    Hard drive(s) free capacity
    Video card make and model
    Camera make and model
    Then describe what you have done so far and the symptoms you are seeing.

  • Download not working shows file damaged.

    Download not working.  Shows files damaged or I should covert original to pdf.  Where is original?  When I try even that does not work.  Download is picking location.  Not allowing me to pick location of download.  Very frustrating.

    I don't understand your question at all.  Download what?  Is it a download of a trial version of PSE12 from Adobe website.  If so then you can't covert the downloaded file to PDF because it is in binary format.
    You need to explain what exactly you are doing.

  • Issue with File Download(messageDownload) on Search Page.

    Hi,
    I created a custom OAF search page which fetches values from one table. The document in getting stored in my custom table in a BLOB colums and NOT in FND_LOBS.
    The table has 3 collumns along with others:
    1st is primary key (Record_Seq) ==> number data type
    2nd to store actual file name (File1Name) ==> varcahar2 data type
    3rd to store the actual uploaded data (File1Data) ==> BLOB data type
    The reason for having the “File1Name” is so that I can display the original file name of the document that was uploaded, instead of just the “view” in the search page results .
    On the File1Data BLOB and created a messageDownload for that under query results table with following details:
    ID : File1Data
    ItemStyle : messageDownload
    FileMIME Type : pdf
    Datatype : BLOB
    View Instance : LacEmpExposureVO1
    view Attribute : File1Name
    File View Attribute : File1Data
    When I click on the "File1Name" data hyperlink, it is opening only the first document corresponding to the first record in the search page results.
    For example, If my search page returns 10 rows then when I click on the file1name on any row, It is open the first row file name only.
    I have a primary key column(RECORD_SEQ) in the Table / EO / VO which is displayed in the search page results.
    Also one weird thing is happening:
    If I try to do this more than 2 times then it is opening the update page with the first record from the search page results…
    I tried to print the context and it is nul the first time, But the second time then context is changing to "update". Dont know how this is happening????
    Any advice is greatly appreciated as it is very crucial for me to get this resolved ASAP. I have looked at several forums and did a lot of things as advised in the forums . But nothing seems to work for me.
    Thanks,
    Mir
    CO code for the search page
    ===========================
    if (pageContext.getParameter("Create")!= null)
    System.out.println("Into LacEmpExposureCO in PROCESS FORM REQUEST with Context of CREATE");
    pageContext.setForwardURL
    ("OA.jsp?page=/lac/oracle/apps/lac/lacempexposure/webui/LacEmpExposureCreatePG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, //Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
    OAWebBeanConstants.IGNORE_MESSAGES);
    else if ("update".equals(pageContext.getParameter(EVENT_PARAM)))
    System.out.println("Into LacEmpExposureCO in PROCESS FORM REQUEST with Context of UPDATE");
    System.out.println("LacEmpExposureCO ==> RecordSeq in PROCESS FORM REQUEST is: " + RecordSeq);
    HashMap params = new HashMap(1);
    params.put("RecordSeq", RecordSeq);
    pageContext.setForwardURL
    ("OA.jsp?page=/lac/oracle/apps/lac/lacempexposure/webui/LacEmpExposureUpdatePG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    params,
    true, //Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO, // Do not display breadcrumbs
    OAWebBeanConstants.IGNORE_MESSAGES);
    else {           
    String strEvent = pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM);
    System.out.println(strEvent);
    System.out.println("Into the last ELSE part in LacEmpExposureCO.java");

    Duplicate post -- Issue with File Download(messageDownload) on Search Page.

  • Flash file, clicks not working in one environment

    Hi everyone,
    I have produced files using Captivate 2, that have output as .exe. These work perfectly across all of our sites, except one.
    The only issue with the site where the files are not working is:
    - Click box within the Flash file do not progress to the next page
    I have output with 'Playback control' and the users at the site in question are able to progress through along the Playback bar. However, I only placed this in for the purposes of testing the file. The final files need to not have the 'Playback control'.
    Does anyone know what I can do differently, to ensure the click boxes work on this site in question?
    I look forward to hearing from you.
    Ravi Sandhu

    Hi Ravi
    I'm not sure I fully understand your question. You seem to be saying a Click Box isn't working. But you say the "Click Box within the Flash File". I'm not sure if this means you have used Flash to create a button or something that you are trying to use with Captivate or if you simply mean that you have used Captivate to create a SWF, and inside that SWF the Click Box doesn't seem to work.
    What would be helpful is if we could see the project first hand. Are you able to post the .CP file for us to download and view? If that's not possible, what about posting a screen capture of the slide with the issue where we can see the entire timeline and all objects.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • File- Print not working from SQL Developer 1.2.1 Build MAIN-32.13

    File->Print not working from SQL Developer 1.2.1 Build MAIN-32.13.
    I downloaded sqldeveloper-1.2.1.3213.ZIP and extract to a local directory. From the extracted directory I ran ..\sqldeveloper\sqldeveloper.exe from Windows XP sp2. The program itself seems to run just fine but File-Print doesn't do anything. In Help-About, Java Platform is reported as 1.5.0_06 and Oracle IDE is 1.2.1.3213. I'm not sure where to look for what is causing the problem.
    Thanks

    I hadn't tried CTRL-P before but I did today. On the first attempt, I saw a small jump in the memory usage for sqldeveloper.exe as reported in Windows Task Manager. Otherwise, there was no change. A second CTRL-P in the same session produced a further bump but subsequent attempts in the same session produced no further change in CPU or Memory Usage.
    Using Task Manager to monitor this further, I tried File->Print again and saw that sqldeveloper would periodically climb to 1 or 2 percent CPU and consume a little more memory. After a minute or so, though, all activity stops again.
    I do not get a print dialog box from SQLDeveloper using either CTRL-P or File->Print

  • I bought Numbers because my Excel files would not work with Mavericks. How can I import a non-functioning Excel file into numbers? (As of now, the file NAME transfers but data is not.) but

    I bought Numbers because my Excel files would not work with Mavericks. How can I import a non-functioning Excel file into numbers? (As of now, the file NAME transfers but data does not.)

    HI Dave,
    I'm surprised you get no message when you attempt opening the Excel document in Numbers.
    I'm assuming Numbers 3.1, since you are running Mavericks.
    Does the Numbers file that opens show any content?
    Does it contain a table?
    How large?
    Does it contain more than one tab (indicating more than one sheet)?
    Do those other tabs contain a table?
    Have you checked those tables for data content?
    There have been cases in the past of imported documents opening with white text on a white background, giving the appearance of containing nothing. Check for this by selecting a block of cells, then applying a Fill colour or a Text colour using the Format button (paintbrush).
    I'd also suggest attempting to open the Excel files using LibreOffice, which can be downloaded from the linked website.
    Regards,
    Barry

  • OTN Oracle Database Downloads Not Working

    After agrgeeing to the T&C's none of the download links work.
    See this page for example:
    http://otn.oracle.com/software/products/oracle9i/htdocs/linuxsoft.html
    Specific Download not working:
    http://download.oracle.com/otn/linux/oracle9i/9202/ship_9202_ia64_lnx_Disk1.cpio.gz
    Regards,
    Andrew

    Seems to be fine. Try this link instead: http://otn.oracle.com/software/htdocs/devlic.html?http://download-west.oracle.com/otn/linux/oracle9i/9202/ship_9202_ia64_lnx_Disk1.cpio.gz
    OTN Team

  • SWF Files do not work in Firefox. My sites work fine in Explore & Safari? Why is this? I have updated all my plugins, reinstalled yet still nothing?

    SWF Files do not work in Firefox. My sites work fine in Explore & Safari? Why is this? I have updated all my plugins, reinstalled yet still nothing?

    Can you post a link?
    Does that only happen on that website or do you have that problem with all Flash content?
    Reload web page(s) and bypass the cache.
    * Press and hold Shift and left-click the Reload button.
    * Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    * Press "Cmd + Shift + R" (MAC)
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • .jar file is not working properly :developed in NETBEANS

    Hi Gurus,
    i am using NETBEANS IDE 7.2.
    i am developing a project that interacts with databases 10g and COM ports of machine , these all processes are performed by .bat file which i am trying to run from jFramform , code works perfectly .bat file is also called perfectly when i run the project using F6 from the NETBEANS, for testing i placed some dialogue boxes on the form to test it ,
    but when i run executable .jar  file , form run successfully and dialogue box works perfectly but .bat file is not called by executable .jar file.
    this is how i call the .bat file...
      String filePath = "D:/pms/Libraries/portlib.bat";  
            try { 
              Process p = Runtime.getRuntime().exec(filePath); 
            } catch (Exception e) { 
                e.printStackTrace(); 
    and below is the contents of portlib.bat file
    java -jar "D:\SMS\SMS\dist\SMS.jar" 
    you must probably ask why i am calling a .jar file using .bat file .
    reason is that this .jar project sends message using GSM mobile , System.exit(); is compulsory to complete a job and then do the next one ,
    if i use the same file to execute this job it makes exit to entire the application (hope you can understand my logic).
    that's why i use extra .jar file in .bat file , when single job is completed .bat exits itself and new command is given.
    Problem is that code is working perfectly in NETBEANS when i run the project but when i run .jar then .bat file is not working  ,
    thanks.

    Thanks Sir ,
    You need to first test an example that works like the one in the article.
    There are plenty of other examples on the web - find one you like:
    http://javapapers.com/core-java/os-processes-using-java-processbuilder/
    I tried this one.
      try {
                ProcessBuilder dirProcess = new ProcessBuilder("D:/SMS/SMS/Send_message.bat");
                 File commands = new File("D:/SMS/SMS/Send_message.bat");
                 File dirOut = new File("C:/process/out.txt");
                 File dirErr = new File("C:/process/err.txt");
               dirProcess.redirectInput(commands);
                 dirProcess.redirectOutput(dirOut);
               dirProcess.redirectError(dirErr);
                 dirProcess.start();
            } catch (IOException ex) {
                Logger.getLogger(mainform.class.getName()).log(Level.SEVERE, null, ex);
    as instructed in the article i compiled  both the projects at same version or sources and libraries which is 1.7
    here is my version details
    C:\>javac -version
    javac 1.7.0_07
    C:\>java -version
    java version "1.7.0_07"
    Java(TM) SE Runtime Environment (build 1.7.0_07-b11)
    Java HotSpot(TM) Client VM (build 23.3-b01, mixed mode, sharing)
    inside the NETBEANS IDE c:\process\err.txt  remains empty and code works perfectly , but when I run executable .jar file( by double clicking on that file in dist directry) then c:\process\err.txt becomes full with this error text and there is no response from calling D:\SMS\SMS\send_message.bat
    here is the error text
    java.lang.UnsupportedClassVersionError: sms/SMSMAIN (Unsupported major.minor version 51.0)
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Exception in thread "main"
    here is /SMS/SMS
    unknown source ?

  • File- Export not working after upgrade from 11i to R12

    Hi,
    File -> Export not working after upgrade from 11i to R12.1.3 in few systems. Can you please let me know what could be the issue.
    If export record count more than 200 it is working fine in all the systems and if change the profile option "Export MIME type” value to ‘text/tab-separated-values’ from application/excel also it is wokring.
    Thanks and Regards,
    Jagadeesha

    Enabled the FRD. Below are few last lines. Can you please let me know what i can in this log file contents.
    In Argument 1 - Type: String Value: global.frd_debug
    Executing GET_ITEM_PROPERTY/FIELD_CHARACTERISTIC Built-in:
    In Argument 0 - Type: Integer Value: 196613
    In Argument 1 - Type: Number Value: 54
    Out Argument 0 - Type: String Value: 12
    Executing COPY Built-in:
    In Argument 0 - Type: String Value: Entering app_menu.set_prop.
    In Argument 1 - Type: String Value: global.frd_debug
    Executing FIND_MENU_ITEM Built-in:
    In Argument 0 - Type: String Value: FILE.EXPORT
    Out Argument 0 - Type: Integer Value: 19
    Executing GET_MENU_ITEM_PROPERTY Built-in:
    In Argument 0 - Type: Integer Value: 19
    In Argument 1 - Type: Number Value: 79
    Out Argument 0 - Type: String Value: TRUE
    Executing COPY Built-in:
    In Argument 0 - Type: String Value: Completed app_menu.set_prop.
    In Argument 1 - Type: String Value: global.frd_debug
    Executing COPY Built-in:
    In Argument 0 - Type: String Value: Completed app_synch.menu_toolbar_sync. Event is WHEN-NEW-ITEM-INSTANCE.
    In Argument 1 - Type: String Value: global.frd_debug
    Executing NAME_IN Built-in:
    In Argument 0 - Type: String Value: GLOBAL.APP_CUSTOM_MODE
    Out Argument 0 - Type: String Value: NORMAL
    Executing NAME_IN Built-in:
    In Argument 0 - Type: String Value: GLOBAL.APP_CUSTOM_MODE
    Out Argument 0 - Type: String Value: NORMAL
    Executing COPY Built-in:
    In Argument 0 - Type: String Value: NULL
    In Argument 1 - Type: String Value: GLOBAL.OUT
    Executing USER_EXIT Built-in:
    In Argument 0 - Type: String Value: FND GETPROFILE NAME="UPK_RECORDING_ENABLED" FIELD="GLOBAL.OUT" N
    FNDCPVCM, 11, Built-In, Entry, 316509814, USER_EXIT
    FNDCPVCM, 11, Built-In, Exit, 316509814, USER_EXIT
    Executing NAME_IN Built-in:
    In Argument 0 - Type: String Value: GLOBAL.OUT
    Out Argument 0 - Type: String Value: N
    Executing NAME_IN Built-in:
    In Argument 0 - Type: String Value: system.current_form
    Out Argument 0 - Type: String Value: FNDCPVCM
    Executing NAME_IN Built-in:
    In Argument 0 - Type: String Value: system.current_block
    Out Argument 0 - Type: String Value: MASTER
    Executing NAME_IN Built-in:
    In Argument 0 - Type: String Value: system.current_form
    Out Argument 0 - Type: String Value: FNDCPVCM
    Executing NAME_IN Built-in:
    In Argument 0 - Type: String Value: system.current_block
    Out Argument 0 - Type: String Value: MASTER
    Executing GET_APPLICATION_PROPERTY Built-in:
    In Argument 0 - Type: Number Value: 75
    Out Argument 0 - Type: String Value: IHR40P
    Executing COPY Built-in:
    In Argument 0 - Type: String Value: Completed call_all_libraries. Event is WHEN-NEW-ITEM-INSTANCE.
    In Argument 1 - Type: String Value: global.frd_debug
    Executing COPY Built-in:
    In Argument 0 - Type: String Value: Completed app_standard.event. Event is WHEN-NEW-ITEM-INSTANCE.
    In Argument 1 - Type: String Value: global.frd_debug
    FNDCPVCM, 10, Prog Unit, Exit, 316509814, /FNDCPVCM-3/P45_30_DEC_201223_28_33
    FNDCPVCM, 9, Trigger, Exit, 316509814, WHEN-NEW-ITEM-INSTANCE
    FNDCPVCM, 8, Prog Unit, Exit, 316509814, /DMU-4/P8_30_DEC_201223_23_12
    # 15 - FNDCPVCM:MASTER.USER_CONCURRENT_QUEUE_NAME.1359399301498413820
    WINDOW FNDCPVCM PROGRESS_INDICATOR RESIZE 4198 1500 3
    # 16 - FNDCPVCM:MASTER.USER_CONCURRENT_QUEUE_NAME.1359399301512613925
    WINDOW FNDCPVCM PROGRESS_INDICATOR RESIZE 4198 1500 3

Maybe you are looking for