ADF: How to get the path of the file when you use component InputFile

Hi all

I use jdeveloper 11.1.1.5.0 version.

in my case, I created program Mail Client mail where I used the ADF InputFile component for attach file mail.

but problem is this return path only component InputFile from the file (only the filename get)

and in my mailer class DataSource uses the full path name of file access.

UploadedFile uploadfile=(UploadedFile) actionEvent.getNewValue();
     String fname= uploadfile.getFilename();//this line only get file name.

so, how can I get the full path using adf InputFile component or any other way to respond to my request.

Thank you

Manish

Try this (I did not, so I can't promise it will work):

MimeBodyPart messageBodyPart = new MimeBodyPart(uploadFile.getInputStream());
messageBodyPart .setFileName(uploadFile.getFilename());
messageBodyPart.setContent(multipart);

It does use the inputStream from the downloaded file as the content of the file attached. You shouldn't need a full path, since you're not going to use a file object to provide the content.  And it shouldn't be necessary to define the DataHandler.

But if that doesn't work, I go back to my first answer.  Use uploadFile.getInputStream () to get the inputStream from the downloaded file, create an outputStream to write the file to the file system of the application server.  Then you have a file with a known path that you can subscribe to the DataHandler.  You can delete the file when you're done with him.

Tags: Java

Similar Questions

  • How to enter the character ü when you use the pinyin keyboard?

    How can I enter the character u when you use the pinyin-simplified keyboard, for example, for the opening of the syllable nu with your 3.

    The keyboard pinyin-simplified is for entering the characters han, not latin.  If you want to type the latin pinyin, you must use the extended ABC keyboard configuration.  A list of the shortcuts is to

    http://symbolcodes.TLT.PSU.edu/accents/codemacext.html

  • get the error when you use the TRIM method in the collections

    Hi Experts,

    When you use the TRIM method I get below error. I make any mistake here?

    DB: Oracle 11g

    SQL > declare

    2

    emp_tab of type 3 is the employee table % rowtype index directory.

    4 l_emp_tab emp_tab;
    5

    6 start

    7

    8 select * bulk collect into l_emp_tab of employees;

    9 l_emp_tab.trim (5);

    10 dbms_output.put_line (l_emp_tab.count);

    11

    12 end;

    13.

    l_emp_tab. Trim (5);

    *

    ERROR on line 9:

    ORA-06550: line 9, column 2:

    PLS-00306: wrong number or types of arguments in the call to 'TRIM '.

    ORA-06550: line 9, column 2:

    PL/SQL: Statement ignored

    Thanks in advance for your help.

    See you soon,.

    Suri

    For PL/SQL collections "index by" you cannot use the TRIM function. If your collection statement excludes the portion "index of...» ", then you can.

    Gerard

  • How to get SC IP and IP VMK when you use a dvswitch

    Hello, I was wondering if there is an easy way to get IP addresses for virtual cards, I've specified for management and vmotion when you use distributed vswitches.  I saw the site of Luke where he created some dvswitch functions but I was wondering if there was already a way to get this information?

    In PowerCLI 4.1 the Get-VMHostNetworkAdapter cmdlet also returns the modules for exchanges on dvSwitches.

    Get-VMHost  | Get-VMHostNetworkAdapter -Console:$true | Select VMHost,PortGroupName,IP
    

    shows the IP addresses for all SC, also those on a dvSwitch.

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • How to get the event when you click Add another button in a table.

    Hello
    How to recognize the event in processFormRequest click on the button Add another line of the footer of a table?

    Suppose if the ID is anotherRow (I mean ID of the button to add another line of the footer)

    If I give if (pageContext.getParameter ("anotherRow")! = null)... its not recognizing the event that is returning null only...

    I want to perform certain actions when the user clicks Add another line of footer. Please let me know the details of how identify when add another line is clicked...

    Thank you
    Srikanth

    Hello

    If you have only one table with add_row_button, and then copy the following code works perfectly

    If (tableBean.getName () .equals (pageContext.getParameter (SOURCE_PARAM)))
    (& ADD_ROWS_EVENT.equals (pageContext.getParameter (EVENT_PARAM)))
    {
    ...
    }

    tableBean is the Handle for your advanced table, hope, it will help you.

    Kind regards
    Out Sharma

  • How to capture the pointer when you use print screen in Vista?

    I am writing instructions for three classes of Excel, and I want to capture the different sliders to include in the directions.  Of course, when I use print screen, they disappear, so nobody knows how to capture them?

    Hello

    I suggest you to try the cutting tool and check if it helps.

    Use the cutting tool for screenshots:

    http://Windows.Microsoft.com/en-us/Windows-Vista/use-Snipping-Tool-to-capture-screen-shots

    I hope that helps!

  • Get the error when you use the Oracle 9.2 on RRS 4 installation

    Hi all

    I was getting error while installing oracle 9.2.0.4 in Red hat advanced server 4

    YES was generating a message
     could not able to relink ins_sqlplus.mk  and ins_rdbms.mk
    but I'd ignored, after installation of the oracle s/w, I relinked bleow files

    I also tried running the command below
    [oracle@oracle lib]$ make -f ins_sqlplus.mk install
    
    but when i try to make ins_rdbms.mk i was getting a error
    
    [oracle@oracle lib]$ make -f ins_rdbms.mk install
    .
    .
    .
    .
    .
    ..
    .
    u01/app/oracle/product/9.2.0.1/db_1/lib32/libgeneric9.a   `cat /u01/app/oracle/product/9.2.0.1/db_1/lib32/sysliblist` -Wl,-rpath,/u01/app/oracle/product/9.2.0.1/db_1/lib:/lib:/usr/lib -lm    `cat /u01/app/oracle/product/9.2.0.1/db_1/lib32/sysliblist` -ldl -lm    -lvsn9
    /usr/bin/ld: crt1.o: No such file: No such file or directory
    collect2: ld returned 1 exit status
    make[1]: *** [/u01/app/oracle/product/9.2.0.1/db_1/rdbms/lib/extproc32] Error 1
    make[1]: Leaving directory `/u01/app/oracle/product/9.2.0.1/db_1/rdbms/lib'
    Please suggest me if this will have an impact on the DB

    Published by: user00726 on July 8, 2009 23:06

    If the error only occurs when you start the dbca Wizard, the database itself should be ok. Before using it for the production you can stress test your db using swingbench or hammerora to be sure that iti works well.

    Concerning

    Oliver

  • FFox 17 on WinXP. How to stop the scrolling when you use mousewheel

    FFox 17 Win XP
    When I use the mouse wheel to scroll I want vertical scrolling only. But it appears a circle icon and not scroll anywhere, or try to go on the side and skids in all directions.

    I would like to prevent the mousewheel to make a horizontal scrolling (and never see again this circle icon). Is this possible?

    p.s. I saw the page "Gecko: mouse scroll wheel - MozillaWiki" and although it is very complete, it is really written by/for developers, I want just a patch to input simple config... Please?

    See tools > Options > advanced > general: navigation: "use autoscrolling".

  • Why Lightroom will not save the file when you use the image Capture?

    When you work with video in Lightroom 5, whenever I press "Image Capture", I get an error message that says: "cannot save the file." I tried this on several video files, and I get the same message. Video files are. MOV files. I can't understand why this is happening!

    I had this same error message. I solved it when I moved the video file on the hard disk internal to the computer, and then it worked perfectly. He always gave the error message when I used an external video file from my hard drive. There for a long time until I tried this. No one answered this problem in forums that I could find.

    I hope this helps.

  • How to fix the "stutter" when you use the YouTube widget

    I use the YouTube widget that comes with 8 Captivate, and it works almost perfectly.  The only problem is it is hard noticeable half a second to load and e-Learning "flashes".  I tried to put a screen behind the YouTube thumbnail widget, but that seems to flicker as well...

    Does anyone have experience with this problem?

    Thank you!!

    Try it on a server and see if it still does the same thing. I only worry about this if it does not work in the environment that the course will finally reach.

  • Get the error when you try to manually create a restore point in Vista 32 - Bit - System - Protection of the system control panel. Got the unable to create the specified task

    Get the error when you try to manually create a restore point in Vista 32 - Bit - System - Protection of the system control panel.
    Got the unable to create the specified task

    Hello

    What is the exact error message received when the problem occurs?

    Methood 1:

    Auditor of file system (CFS) scan to fix all of the corrupted system files. To do this, follow the steps in the following link:

    How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7

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

    Method 2:

    You can start Windows Vista by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    I suggest to put the computer in a clean boot state, and check if the problem persists, see the link:
    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/kb/929135
    Note: See step 7; Reset the computer to start as usual after troubleshooting is performed.

    Method 3:

    You can temporarily disable the security software and check if the problem occurs. Check out the following link to do the same thing:

    http://Windows.Microsoft.com/en-GB/Windows-Vista/disable-antivirus-software

    Warning: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you need to disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks.

    I hope this helps! Let us know if you need more assistance.

  • How can I reduce the size of the file when you save a psd in pdf format

    I have a psd with graphics and text, it is 8.5 x 11, 300 dpi

    I flatten the image and go to save as .pdf file I uncheck all options in general.

    Compression, I tried a dozen different combinations and the way I found to get a document that is not pixelated or blurred is to use JPEG 2000 > lossless or jpeg > maximum.

    So I have a document of high quality but the file sizes are approximately 900 KB.

    I downloaded the documents of others of the exact same type and size (8.5 x 11, 300 dpi) that I have seen in Photoshop, they aren't pixelated or blurred and their file sizes are 300 KB or even less than 200 KB

    How do do that?

    Delete all layers used, invisible.

    Zip compression is sometimes better than the jpg compression (in the pdf output settings). Zip is lossless and it works best with a color not degraded or not images.

    Flatten the image before saving it to pdf format can reduce the size of the file, if you use the jpg compression.

    See a preview of your pdf file and we can comment further on how to reduce the size of the file.

  • How can I customize the toolbar when you use the browser of the attribute

    In CVI 2012, changes in the toolbar depending on the environment, for example, it is different to the source window and the user interface editor. The toolbar can be customized using the Options menu / toolbar...

    Unfortunately, when you use the browser of the attribute of the user interface editor, another toolbar is displayed, i.e. not the UI Editor toolbar... I would have assumed that the browser of the attribute belongs to the user interface editor, obviously this isn't... So, how can I customize the toolbar when you use the browser of the attribute?


  • I get the following when you try to run programs such as Nero "this program requires the file AdvrCntr6.dll, which is not on this system."

    I get the following when you try to run programs such as Nero:-"this program requires the file AdvrCntr6.dll, which is not on this system."

    Please can you help me?

    Original title: AdvrCntr6.dll

    Hello.

    There is a guide for fixing here:

    http://pcsupport.about.com/od/findbyerrormessage/a/advrcntr6-DLL-not-found-missing-error.htm

  • Windows 8, 32-bit: how to cancel the file history and use the USB for the sole purpose Ready Boost

    By mistake, I clicked file history on. The USB key used for ready boost is selected and that the disk is write protected. Windows 8, 32-bit: how to cancel the file history and use the USB for the sole purpose Ready Boost. I don't have an another USB suitable for ready boost.

    Hello

    You should be able to disable the history of files by using the local Group Policy Editor.  Consult this publication of the article.  Use the #2 option.

Maybe you are looking for