Download the ADF works for a time the frist

I have a ADF table to JSF page which is bounded to the View Object which contains the files downloaded to the user. This View Object contains all the information needed to download a file like blob domain , file type and file name . For each line, there is a download button that allows the user to download the selected file.

All work of things perfectly for the first time. Problem is when the download user press some file it already download it, the file get damaged. The file appears in the download section for the browser, but when I tried to open it it says the file cannot be opened because the file format or file extension is not supported.

I use Jdeveloper with ADF technology 11.1.2.3

This is the button in the JSF page:

<af:column id="c31">
<af:commandButton text="Download" id="cb12" partialSubmit="true">
  
<af:fileDownloadActionListener method="#{ITDetalisBean.downloadSelectedFile}"
  filename
="#{row.FileName}" contentType="#{row.FileType}"/>
</af:commandButton>
</af:column>

As you can see the button is placed in <af:column> tag. So for each row file it is matching the download button.

Here is the Bean method:

  public void downloadSelectedFile(FacesContext facesContext, OutputStream outputStream) 
{
  
// get the view object from the application module
  
AppModuleImpl appM = (AppModuleImpl)(JSFUtils.getApplicationModule("AppModuleDataControl"));
  
ViewObject fileUploadedVO = appM.findViewObject("UplodedFilesViewTransient1");

  
// get the file content as blob domain from the current row
  
BlobDomain blobDomain=(BlobDomain)fileUploadedVO.getCurrentRow().getAttribute("FileContn");


  
// download the file using output stream
  
try {
  
HttpServletResponse response =
  
(HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse();

  
InputStream in = blobDomain.getBinaryStream();
  outputStream
= response.getOutputStream();

  
byte[] buf = new byte[1024];
  
int count;
  
while ((count = in.read(buf)) >= 0) {
  outputStream
.write(buf, 0, count);
  
}

  in
.close();
  outputStream
.flush();
  outputStream
.close();
  facesContext
.responseComplete();


  
} catch (IOException ex) {
  
System.out.println(ex.getMessage());
  ex
.printStackTrace();
  
} catch (Exception e) {
  
System.out.println(e.getMessage());
  e
.printStackTrace();
  
}
}

In the end, try to call

blobDomain.closeInputStream)

blobDomain.closePutputStream)

Tags: Java

Similar Questions

  • IAM in Turkey and I can't download free I work for my new IPad pro?

    I am in Turkey and I can't download free I work for my new IPad pro, as well as I'm paying my Turkish visa not accepted, what happens?

    many programs give the trial period and then start asking for payment.

    What happens when you try to download the applications? You use the same account that was used to initially activate the iPad, and you tried to log on and the account?

    Free apps: get Pages, Numbers, Keynote, iMovie, GarageBand, and iTunes U for free on your iPhone, iPad and iPod touch - Apple Support

    For the visa card, it is debit or credit? If flow which may be why, not all always seem to work (and would not be allowed at all in some countries).

    A card having a chance to be accepted it must be registered with the same name and address (including the format and spacing etc) that you have on your iTunes account and have been issued by a bank in the same country as yourself (so a Turkish Bank). You have a different card that you can try, preferably a credit card?

  • Program to my computer system restore does not work. He has not worked for some time now. I ran it many times try different restore points, but I found myself still receive the same error.

    I got the same error message every time and he'd jump upward after restarting my computer.  He said something to the effect that there is a kind of disruption that caused the program to close.  If the restore process did not in the end.

    Problems with system restore:

    http://Service1.Symantec.com/support/sharedtech.nsf/pfdocs/2005113009323013

    1. If you use Norton (Etc), disable it before using System Restore. info at the link above.

    2. try SR in safe mode:

    Try typing F8 at startup and in the list of Boot selections, select Mode safe using ARROW top to go there > and then press ENTER.

    Try a restore of the system once, to choose a Restore Point prior to your problem...

    Click Start > programs > Accessories > system tools > system restore > choose another time > next > etc.

    3 Malware will stop at the system restore:

    If necessary, do all of the above work Safe Mode with network.

     

    To get into Safe Mode with network, press F8 at the Power On / boot and use key arrow upward to get into SafeMode with networking from the list of options, and then press ENTER.

    http://www.Malwarebytes.org/MBAM.php

    Malwarebytes is as its name suggests, a Malware Remover!

    Download the free Version from the link above.

    Download, install, upgrade and scan once a fortnight.

    At soon Mick Murphy - Microsoft partner

  • Why windows 7 (64 bit) download does not work for a hp officejet 5610 all-in-one?

    I changed operating systems from XP to Windows 7 (64 bit) on a new Toshiba Portege laptop and downloaded the new drivers from the HP site for my all-in-one Officejet 5610.  Nothing went well.  I can print but not scan, and often copy is extremely slow for no apparent reason.

    I deleted the driver downloaded several times and re-uploaded to start from scratch, but get the message "Fatal error during installation."  I used HP correction for this, did everything it says and ran the download as an administrator.  When the "USB connection" screen, I connect the USB as requested, and I hear my computer accepts this connection.   But the HP installer does not accept or acknowledge inserting the USB key.  It hangs at that time here, and keeps installation disc FOREVER chasing the USB connect screen.

    When I open the HP Solution Center, he informs me that he cannot work because the download of device is not complete.

    There is no file 'help' in the menu 'start '.

    I'm running out of ideas on how to make my printer work properly with the new Windows 7 system.

    Someone at - it suggestions?

    In the case where you hear the ding that the USB cable is connected and that the software does not recognize it, it means that at any given time you connected to the computer via the USB port before running the software. When you do so, Windows takes over and tries to install their own drivers. That causes problems later, when you try to use the software, as it will then not connect when you use the USB cable.

    In this case, you must connect via the usb port and go into Device Manager and remove everything related to your printer. After you do this, unplug the USB cable and restart your computer. When starting BACK, run the software FIRST and then when he asks the USB cord this time, it should recognize the connection.

  • Where is a download link to work for CS5?

    I have a series/license for Adobe CS5 Master Collection Design that was purchased, I have a new computer to install this software via a downloadable file. When I check the Adobe website, there is nothing listed with a working download link. I get:

    Access denied
    You do not have permission to access to " " http://trials2.adobe.com/AdobeProducts/STAM/CS5/win32/MasterCollection_CS5_LS1.exe? " on this server.

    Reference #18.a5440317.1374449396.c2d4169

    http://prodesigntools.com/all-Adobe-CS5-direct-download-links.html

    I try to download the MasterCollection_CS5 and I followed the instructions using different browsers. I used firefox and chrome and still get this error.

    Help, please. I need this program to work. Thank you

    http://prodesigntools.com/all-Adobe-CS5-direct-download-links.html

    Make sure you follow each step in the very important Instructions before proceeding with the actual download.

  • Tabs Panel: How can I designate a default tab? The site with the tab wanted to selected download does not work for me.

    I created a tab panel and applied some styles to tabs. (Drop shadow and change the stacking order so that each tab casts a shadow on that below.) Now everytime the page loads, it will default to the lower tab. The only suggestion that I've seen is to save and load the site with the desired tab is selected and 'active'. This does not seem to solve the problem.

    Hmmm, have you looked into this widget from MuseGrid? It looks like roughly what it takes for this?

    News a new star | Adobe Muse Widget | museGrid.com

  • 'Add files to download' does not work for my custom css file...?

    From now on, I have several snippets of CSS stylesheet in the HEAD of various pages tag, but I want to combine them all into a single file "custom.css" and it just a link to specific pages. So I have created "custom.css" in my 'active' projects folder and want to add it then my site by 'Add files to download' under the menu 'File' in MUSE. But I always get the message

    The X:\xxx\xxx\xxx\Assets\custom.css file is not a supported file format


    Is this possible? I think that used to work some time ago, I had a model that uses custom css files... Why is a css file not supported? Does not make much sense to me...

    I CAN add files jpg or svg to png oder so it doesn't seem to be a problem...?

    Thank you!

    Custom CSS in Muse can be placed at the head of each page.

    It there's no way that Muse can locate the css custom code in an active file and apply it to a specific page.

    Muse export all css on each page and stores it in a separate css file.

  • My internet no longer works for short time every 10 minutes approximately

    All the ~ 10 minutes my internet stops at 10 seconds... Please help if possible tried many things, but does not and I've rarely seen someone, even after only for the wireless and I have a CABLE CONNECTION

    Hello

    Allows to control which application is contradictory:

    Step 1: Start your computer in safe mode with networking

    http://Windows.Microsoft.com/en-us/Windows-Vista/start-your-computer-in-safe-mode

    Note: Safe mode starts Windows with a limited set of files and drivers. Startup programs do not work in safe mode, and only the basic drivers needed to start Windows are installed

    If the problem does not occur in Safe Mode with networking , we can use the approach 50 / 50 to narrow down the root cause of the problem.

    Step 2: Refer to the section below for instructions on how to start your computer in a clean boot state.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

    Note: When the diagnosis is complete, don't forget to reset your computer to normal startup. Follow step 3 in the above article.

    Please follow these recommended steps, review the additional information provided and post back if you still have the problem. I'll be happy to provide you with additional options available that you can use to get this problem is solved.

  • Real player Downloader doesn't work Firefox 23.0

    My true Downloader has not worked for a while. Any help? Thank you.

    Real player still play OK, the Real downloader to download web videos (Youtube, APOD, any web site) will not download the video. Something stops working after each update of firefox. Back to MSIE until this problem is corrected.

  • I want to create a counter for every time my completed loop

    Hi my program works for a time given and writes the data to a file. When the time is reached, the program goes into a loop of 'pause', where nothing happens and then begins to run. I want to be able to decide have several times, he runs the program. I know that I can use a loop for, but I want to try to use some sort of counter as you can see in the file attachment below. After the counter reaches the value of data, then the whole of the program stops.

    Thank you!

    Why not do what you are already showing with a registry to offset, increment, and comparison in the while loop?

    (You should do these integers values rather than double because you just count.  You can run into problems when when comparing floating point numbers (double) for equality.)

  • A 9 Ff and worked well. 1.5 weeks, tried to download the update to 10.0.2, there but she would even BEGIN to download - no "run" window comes up, not on the desktop, not in list programs. Have retried for days!

    I use Windows 7 on a Dell 2 years computer (running 32 & 64-bit). So, things I read, I thought it might help to uninstall my old version (I think it's 9), then try again. I did, and EVEN download anything. I tried it at different times of the day and at least 5 days, but nothing works. Just like before, not even a hint that download anything (and he never said anything about firewall issues). I tried with and without firewall, etc. being extinguished. What can I do? Is there a person live anyone can help guide me through this over the phone? (ha ha!) Really, I like phone or chat at least helps. -I'm pretty informed on the use of computers and software, but it left me speechless. Help, please! -If I can't get to download and work 10.0.2, can I download an older version (such as 9)? -under 'what happened' below, no answer is part, because it is ALWAYS the same. No download. Bob

    Please note that choose run or Open in the dialog box may not work for every type of file under any circumstances. Please also check if the file has been downloaded previously in the downloads folder and right click and run as administrator.

    You can also try right-clicking on the link corresponding to the version of language here and Save target under. You can try to save in a custom location and if it downloads successfully, right-click on the file and run as administrator.

  • When I try to download a new version for my IPad, it keep saying the elapsed time for your internet connection, check your network. What can I do?

    When I try to download and update a more recent version of the software of my ipad, it works for the first 10 minutes, then it stops showing me what follows: "your internet connection time run out, please check your network."

    How can I solve this?
    Thank you

    Hello

    You should check with Support for iPad.

    iPad Support
    http://www.Apple.com/support/iPad/

    iPad Support Contact
    http://www.Apple.com/support/iPad/contact/

    iPad Communities
    http://discussions.Apple.com/index.jspa

    I hope this helps.

  • McAfee Anti-virus works do not "computer couldn't download the solution at this time." Check that your computer is connected to the Internet tries to download the solution later. » »

    • It is said that my mcafee virus scanner does not work.  The answer I got was "your computer could not download the solution at this time. Make sure that your computer is connected to the Internet and then try to download the solution later. "I tried for a week without result.  The same answer.

    Thank you.

    Lulu

    You must contact McAfee as we do not have knowledge of their products

  • A picture of my computer becomes the work for readers of MP3 download

    original title: an image with an MP3 player

    When a photo in my computer becomes the artwork for a MP3 downloaded?  This has never happened before and now it's happening when I download an MP3 file.

    If you use, for example, WMP or iTunes to play mp3 files, then unless you have blocked access to the web, they time consult databases of 3rd party and try and find the work associated with the said mp3

    You can disable this option in preferences or Option.
    In your case for some reason, something of 'tip' to the image. Go to Option and or preferences and stop it.
    Or use ac3rd such as mp3tag advantage tagger to remove your photo and perhaps then download the correct application and add it to the mp3 tags via the software I mentioned.
    See you soon,.
    Jerry
  • I bought the software for Adobe photoshop lightroom 5 Office depot, I have the serial number to download that will work in the United Kingdom if I sell it to someone out there

    I bought the software for Adobe photoshop lightroom 5 Office depot, I have the serial number to download that will work in the United Kingdom if I sell it to someone out there

    If you have a serial number US and that the person has an ID Adobe UK I don't think it will work... but you'll have to ask Adobe (it is an open forum, not the Adobe support)

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">

    Don't forget to stay signed with your Adobe ID before accessing the link below

    Creative cloud support (all creative cloud customer service problems)

    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

    Read also the transfer (sale of your software) https://forums.adobe.com/thread/1355892

Maybe you are looking for

  • Pavilion Notebook LK8JHHPQ: Factory reset

    HP told me that I have to do a reset to factory my laptop HP Pavilion LK8JHHPQ. I've never done before. Could someone provide instructions for such an operation? If I am not mistaken not all applications and programs provided with the system will be

  • 47L 6453 Smart TV apps are gone

    This morning my 47L 6453 told me it was an update to do. I allowed him to do so. When it is started to my smart TV top had no applications, boxes, icons or anything like that. I have my user name on top, the strength of wifi, the date and time. and a

  • Number of the homescreen on ICS

    Hello After the update to ICS I am facing a problem regularly. When I spend more than a few minutes in an application, and then return to the screen of welcome, all widgets and shortcuts have disappeared. They appear in a few seconds. Also applicatio

  • Adding Photos to the timeline to chance

    Hi all...   Could I highlight all my photos and have them imported into the timeline to chance?  If I can't add randomly... then could prevent photos duplicate in my calendar?

  • Photoshop Mix - transparency png

    Hello, I just change the phone, using iOs. Now in the new when I try to include a logo, it is a PNG with transparent pattern, does not work. Appears only with a white pattern.It worked very well in my previous phone, using the same logo image