Do we have any mechanism to persist af:inputFile value

Hi All,
I am using jdev version 11.1.1.4.0.
I have simple page where I took af:inputFile component and one command button.
In that page for form useupload is also set true. Binding of input file is done in bean which has pageflowscope.
Value is binding with UploadedFile Object.
When I press command button then value of input file should be persist it becomes empty.
Do we have any mechanism to persist af:inputFile value.
Thanks
Sainath

I have already used this file upload mechanism, you can directly use these fuctions :
* @param event
* After selection of File from File Browser, this function will get called
public void fileUploaded(ValueChangeEvent event)
UploadedFile file = (UploadedFile)event.getNewValue();
if (!file.getContentType().endsWith("png") && !file.getContentType().endsWith("gif") &&
!file.getContentType().endsWith("jpg"))
FacesContext context = FacesContext.getCurrentInstance();
FacesMessage message = new FacesMessage("Choose a png, jpg or gif file to upload.");
message.setSeverity(FacesMessage.SEVERITY_ERROR);
context.addMessage(event.getComponent().getClientId(context), message);
return;
String strImageDirectoryInDomain = getDashboardThumbnailDirectoryInDomain();
(new File(strImageDirectoryInDomain)).mkdirs();
String strNewImageFileName = getNewImageFileName(file.getFilename());
File oNewFile = new File(strImageDirectoryInDomain + strNewImageFileName);
OutputStream dout = null;
java.io.InputStream oInputStream = null;
try
oInputStream = file.getInputStream();
byte[] bytes = new byte[1024];
int nread = 0;
dout = new FileOutputStream(oNewFile);
while ((nread = oInputStream.read(bytes)) != -1)
dout.write(bytes, 0, nread);
this.strExternalImage = getImagePathRelativeToWEBINF(strNewImageFileName);
if (file != null)
FacesContext context = FacesContext.getCurrentInstance();
FacesMessage message =
new FacesMessage("Successfully uploaded file " + file.getFilename() + " (" + file.getLength() + " bytes)");
context.addMessage(event.getComponent().getClientId(context), message);
return;
} catch (FileNotFoundException e)
e.printStackTrace();
} catch (IOException e)
e.printStackTrace();
public static String getImagePathRelativeToWEBINF(String strImageName)
StringBuilder oBuilder = new StringBuilder();
oBuilder.append("/images/");
oBuilder.append(strImageName);
return oBuilder.toString();
i hope this will solve your issue.

Similar Messages

  • Since updating my iphone 4S it has started showing no service, i have gone into the apple store and they couldn't fix it does anyone have any suggestions?

    Since updating my iphone 4S it has started showing no service, i have gone into the apple store and they couldn't fix it does anyone have any suggestions?

    They offered to value my iPhone and then put that money towards buying me out of my contract however I don't want to have to spend more money when my contract ends on august anyway.

  • Hi, how do I download acrobat professional 7?  I can't find a link for Mac. I reinstalled CS2 (as my old G4 Powerbook needed reinstalling), but it didn't install instal Acrobat or Distiller.  Adobe don't seem to have any contact mechanism.

    Hi, how do I download the replace CS2 acrobat professional 7?  I can't find a link for Mac. I reinstalled CS2 from adobe (as my old G4 Powerbook needed reinstalling), but it didn't install instal Acrobat or Distiller.  Adobe don't seem to have any contact mechanism.
    I put my old acrobat back onto my machine (from a backup made before reformatting) but it wants the box serial number.  when I did that however, the replacement CS2 photoshop, etc, wouldn't work, so I had to install it again, but then, you guessed it - acrobat won't work again.

    Hello Alan,
    Acrobat 7 is older version. Refer below link for more information and how to download.
    Error: Activation Server Unavailable | CS2, Acrobat 7, Audition 3
    Adobe has made earlier versions available for customer's convenience.
    Hope all will go well !!

  • I am trying to download an album from ITUNES and I keep getting a "session has timed out" message with no further option but to try again. I get the same results. Anyone have any ideas?

    I am trying to download and album off ITUNES but when I get to the billing site and attempt to purchase it, it gives me a message saying "Your Session has timed out." It gives me no other option that to try again and I just keep getting the same results. Anyone have any ideas on what I can do?

    Hi, Kenny. 
    Thank you for visiting Apple Support Communities. 
    There are a couple things that I would recommend trying.  Try closing all open applications and power cycle the device.  Next, go through the section labeled Troubleshoot issues on an iPhone, iPad, or iPod touch in the second article below.  If the issue persists, try completely signing out of the iTunes Store on the iOS device and sign back in.  Be sure to test downloading an application after each step. 
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    iOS: Changing the signed-in iTunes Store Apple ID account
    http://support.apple.com/kb/ht1311
    Cheers,
    Jason H. 

  • My hand me down MPC keeps repeating the start up chime and nothing comes on and no buttons have any effect. Any ideas?

    MY "hand me down" Mac Book Pro has decided that it will not boot up. I just get the first chime repeating over and over and none of the keys seem to have any effect at all. I cannot get into safe mode etc. My nearest Apple S tore is about 40 miles away. Any ideas out there?

    Alanmeats,
    Do you know the year of production (e.g., "15-inch Late 2011")?
    Never mind - it looks as if it's a mid-late 15" 2009.
    It's sounds as if your problem is something mechanical - a bad drive, something, that will simply not allow the system to boot. Do you have the discs that originally came with the machine (gray discs)? If so, you can try booting from Disc One and see if you can boot into recovery mode. If not, you'll need to call Apple, with your serial number handy, and purchase a set of the machine-specific discs that came with the system (10.4.9 or 10.4.10 or perhaps even 10.5).
    Then you can see if you've a hardware or system problem.
    Clinton
    MacBook Pro (15-inch Late 2011), OS Mavericks 10.9.4, 16GB Crucial RAM, Crucial M500 960GB SSD, 27” Apple Thunderbolt Display

  • I can't open any attachments on gmail, does anyone have any suggestions as to how to fix?

    I can't seem to open up any attachments in gmail.   Does anyone have any suggestions as to how to fix?   Thank you

    Hello Jim,
    Thank you for providing the details of the issue you are experiencing with opening attachments in Mail on your iPad.
    I recommend following these steps for an issue like this (you can skip 4 because it does not relate to the issue you are experiencing and any other steps you may have taken):
    If a single application is not responding or stops responding when it opens, you can force it to close.
    If the device is unresponsive or if certain controls aren't working as expected, restart your device.
    If the device remains unresponsive or does not turn on (or power on),reset your device.
    If there is no video or if the screen remains black, verify that the device has enough charge to turn on:
    If you are using an iPad, ensure that it's connected to the USB Power Adapter supplied with the device.
    Let charge for at least twenty minutes, then see if it starts normally.
    If there is no image on the screen, press the Sleep/Wake button to attempt to wake the device.
    If the screen displays a red battery icon, continue charging the device until the battery is fully charged.
    If the above steps do not resolve the issue, or the if the screen remains black or shows a persistent Apple logo, try restoring with iTunes:
    Connect the device to your computer and open iTunes.
    If the device appears in iTunes, select and click Restore on the Summary pane. Learn more about restoring iOS software.
    If the device doesn't appear in iTunes, try to force the device into recovery mode, and then restore it.
    If the above steps do not resolve the issue, contact Apple.
    You can find the full article here:
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/TS3281
    If you get to step 5, I recommend backing up your iPad before performing the restore:
    iOS: Back up and restore your iOS device with iCloud or iTunes
    http://support.apple.com/kb/HT1766
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Is there any mechanism where Oracle ESB can store messages

    Hello All,
    Is there any mechanism where Oracle ESB can store messages? like MQ does , Due to any reason if any compoenet goes down or Database goes down messages should not lost.
    But not sure if Oracle ESB in Oracle SOA Suite 10g has feature to persist the messages ?
    Waiting for reply.
    Thanks & Regards
    Kumar

    In 10g, ESB doesnot come with this builtin, you can use AQ/JMS to store the messages.
    Regards,
    Shanmu.

  • HELLO! How do I fix this? When I click on imovie "add titles" it closes. I uninstalled the application, to date I have reinstalled, the problem persists, the problem

    HELLO! How do I fix this? When I click on imovie "add titles" it closes.
    I uninstalled the application, to date I have reinstalled, the problem persists, the problem

    Thank you for having responded to me!
    Unfortunately I did already the case "delete preferences" but nothing!
    Also, when crashes do not give me any reports!
    Started in safe mode, with another administrator, the problem becomes even: your video card is not compatible with Quartz Extreme!
    My card is a g-force framework 4000 FOR MAC!!
    STRANGE TRUE!
    If you know something more to this riquardo please answer!
    Thanks Comunity!!

  • WHEN USING FACETIME, THE OTHER PERSON CAN SEE AND HEAR ME BUT I CANT HEAR THEM AND THEIR VIDEO IS A STILL PICTURES.. DOES ANYONE HAVE ANY ANSWERS???

    When using Facetime.. the other person can see and hear me, but I can't hear or see them.. Does anyone have any solutions?? The only thing I can see is a still picture of them

    Hi mduggan,
    Thanks for visiting Apple Support Communities.
    If the other person can't see you during a FaceTime call, first use the Camera app on the iPhone to make sure the camera is working properly. If you don't see an image when using the Camera app, try these troubleshooting steps first:
    If the screen shows a closed lens or black image, force quit the Camera app.
    Ensure the camera lens is clean and free from any obstructions. Use a microfiber polishing cloth to clean the lens.
    Cases can interfere with the camera and the flash. Try gently cleaning the lens with a clean dry cloth or removing the case if you see image or color-quality issues with photos.
    Try turning iPhone off and then back on.
    If your iPhone has a front and rear camera, try switching between them to verify if the issue persists on both.
    You can find these steps and more information here:
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/TS2802
    If the camera is working normally, next troubleshoot FaceTime using the steps in this article:
    iOS: Troubleshooting FaceTime
    http://support.apple.com/kb/ts3367
    All the best,
    Jeremy

  • Dvd stoped being recognized by my cumputer macbook pro the last ones made before unibody came out anybody have any suggestions as to what might be wrong?

    dvd stoped being recognized by my cumputer macbook pro the last ones made before unibody came out anybody have any suggestions as to what might be wrong?

    My eyes just glazed over...Please in the future break down each of your issues with paragraphs separated by two carriage returns. It would be much easier when trying to address your issues.
    Go to Apple menu -> System Preferences -> Keyboard and Mouse -> Mouse
    And edit your mouse settings to do what you want it to do.
    Secondly, this is not the place to vent. If you have a complaint, there is:
    http://www.apple.com/feedback/
    or http://www.apple.com/contact/
    We are just end users here helping other end users.
    Third, from my understanding, it would appear you are concerned about the noise the hard drive makes when it falls asleep? Why not put your machine in screen saver mode instead? Apple menu -> System Preferences -> Energy Saver turn off all Energy Saver settings, or set them to run Never.
    Fourth, if your machine was purchased just a few days ago, you may still be able to get an exchange from the store, quicker than you can get a repair done. You may want to look into that possibility.
    Fifth, it does appear you found the Logic forum. I would persist in asking there how to solve your technical issue with Logic regarding the audio. It may be you don't have to do anything special to the hard drive. Remember audio can be transmitted by wire, avoiding ambient sounds.
    Good luck!

  • Can't synch iphone. Get message "synch server failed to synch the iphone.  ANyone have any suggestions on how to fix this issue?

    Can't synch iphone. Get message "synch server failed to synch the iphone.  Anyone have any suggestions on how to fix this issue?
    Windows 7
    ios 7.1
    iphone 5

    Hello, skifmli
    Thank you for visiting Apple Support Communities.  
    I understand that you are unable to sync your iPhone and receive an error.  I was start with restarting iTunes and your computer.  Once this is done, test the results by attempting a sync.  If the issue persists, go through the troubleshooting steps in the article below.  
    Troubleshooting Sync Services on Windows with Microsoft Outlook 2003, Outlook 2007, or Outlook 2010
    Cheers, 
    Jason H.  

  • FF downloaded some update and now I get error message saying update cannot be installed until I get rid of extra FF copies on computer-but I DON"T have any extra copies. I cannot even uninstall the only FF I now have!

    I have a Toshiba laptop, Windows & Home Premium Edition operating system. I had FF 3.6.3 installed and up until 6:00 today it was sort of working properly. I find out later that my huasband cannot even open the browser, as every time he does, a dialog box opens up whcih says "UPdate cannot be installed. Please make sure no other copies of FF are running on computer, then restart FF to try again." But I do not have any other copies of FF. I really do not like it when FF auto installs stuff without my permission. Many times this stuff is downloaded and installed, only to raise havoc with my computer.

    Try a smc reset:
    http://support.apple.com/kb/HT3964

  • I've just upgraded to IOS 7.0 on my iPhone 5 and the calendar is horrible!  I want to be able to see the who day at a glance not a few hours.  Does anyone have any suggestions?

    What's happened to the calendar in IOS 7.0?  I would like to be able to see the whole day at a glance not just a few hours.  Any suggestions?

    I know what it looks like and what it does.  I need to be able to see the whole day!  A few hours is not helpful for knowing whats ahead.  I don't want to scroll I just want to be able to look at a glance.  Does anyone have any helpful suggestions.

  • After ios5 i no longer have any music on my iphone

    I updated my iphone 4 tp the ios5 and when it was done i no longer have any of my music on my phone. i tried going onto itunes on my computer to re sync it back but it doesnt work. any help on how i can get all of my songs back to my iphone?????

    Uncheck them in the iTunes > Tones sync settings and sync, then check them again and sync.

  • After moving to iCloud I can only get my email through the cloud, no new emails are making it to my home computer. Does anyone have any advice on how to fix this issue?

    After moving to iCloud I can only get my email through the cloud, no new emails are making it to my home computer and .mac account. Does anyone have any advice on how to fix this issue?

    Welcome to the Apple Community.
    Which OS are you using.

Maybe you are looking for

  • I have a new project -- should UIX or JSP be used?

    I am concluding a UIX project now, and though I think UIX is a terrific idea, these factors have been what I've observed about UIX: 1) Few examples. 2) Lack of documentation (either online, or in print). 3) A very small set of functionality compared

  • Version 4 will not open with Mac G4 System10.5.8 Replace ver3 now no Firefox at all . How do I get back to Ver 3 or get Ver 4 to open

    I down loaded Firefox 4 to my Mac Laptop G4 running operating system 10.5.8, 1.67ghz, 2gig ram. When install it in the applicatiion folder I replaced the version 3.6x that I was using. When I try to open Ver 4 I get an error message that iy cant open

  • Error while activating the BSEG table

    hi guys ,             today i joined SAP SCN . I have this error First i appended a structure of 5 fields in BSEG table .Then i tried to delete this append structure. But while deletiing it took nearly 20-25 minutes to process and timed out.So the st

  • ConcurrentModificationException for a GeneralPath

    I've got a problem that I don't know how to solve. I've got a GeneralPath, let's call it path. I've got the normal EDT thread running. I've got a JPanel in a JFrame. I also got a communication thread (separate thread). Now, I get coordinates to add t

  • Cannot add strokes to table

    I am trying to add column strokes to a table, but they won't appear.  I highlight the cells, go Table - Cell Options - Strokes and fills.   In the proxy preview, I uncheck the blue lines for the row strokes and the outside strokes, leaving only a blu