Get Filename from attachements payload

hallo,
I receive email with attachement.I would like store the attachements on the file system (with a receiver File Adapter) with the same name.
Could someone give a tipps.
Thanks a lot
Mat

Hi,
Option 1: Use the Module Processor code in the Mail Adapter and get the file name and use it in the Receiver File Adapter as a variable substitution.
Option 2: Use java Proxy to invoke the MailBox and detach the attachment and construct the XML message and send into XI.
Hope this helps..
Regards,
Moorthy

Similar Messages

  • How to get FILENAME from FILE PATH

    does anyone know how to get filename from a file path for example
    FILE PATH: C:\Project\uploadbean\web\uploads\Button.txt
    returns
    FILENAME: Button.txt

    @BalusC
    ust for a reference cause i'm new in JSP This has nothing to do with JSP, but with basic knowledge of an essential API. I have given you the link to the File API. Are you saying that you refused to read the API documentation, which clearly explains you how to use the File and shows which methods are all available to you undereach the straightforward getName() method, and expecting that the others may chew the answers for you? Loser.

  • How to get filename from mail attachment

    Hi all,
    I have a XI scenario Mail->XI->RFC. I have created my own adapter module which handle all attachments from incoming mail.
    Everything work fine, but in my module I try to get information about filename of mail attachment. I use getContentType() metod to get the filename but this method return only the mimetype of the document. The getDescription() method return olny string "mail attachment". I need to get the original filename of the attachment or at least the file extension. 
    Is it possible to get the whole filename from mail attachment?
    Thanks
    Peter

    Hi,
    You can tryout with adapter modules . You can make use of following Adapter attributes also -
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ad/bf93409c663228e10000000a1550b0/content.htm
    Similar discussion-
    Email attachment file names
    PayloadSwapBean-
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    Regards,
    Moorthy

  • Get filename from file sender adapter

    Hi Experts,
    I have a question regarding the file/ftp adapter (sender).
    I have a directory with xml and pdf files. for every xml file there is a pdf file with the same filename. for example:
    file1.xml
    file1.pdf
    file2.xml
    file2.pdf
    file3.xml
    file3.pdf
    Now I want to read the xml file with the file sender adapter. afterwards I want to read the related pdf file. for example: If I read the file file1.xml afterwards I want to read the pdf file file1.pdf with the file sender adapter. For this it is nessessary to get the filename from the xml file so that I can read afterwards the pdf file. How can I realise it?
    Thanks and best regards
    Christopher

    Hi srinivas,
    thanks for your quick answer.
    That the file adapter is not able to read pdf files is clear to me. In this case I only want to transport the pdf. that works fine. I tested it.
    the problem is the following:
    I have a xml file with the name "file1.xml". I read the xml file with the sender file/ftp adapter configured with filename "*.xml". Then I want to import the pdf file with the name "file1.pdf". Therefor I need the filename from the xml file.do you know what I mean? So XI has to know the filename of the xml to import the pdf with the same name ...
    regards

  • Getting filename from HttpServletRequest

    hi,
    i am doing a simple servlet for uploading file.
    i have been googling around, but i could't find a way to retrieve the filename from the HttpServletRequest object. most solution uses another party's code.
    below is the simple code from the html that takes in the file
    <form action="/TestJSP/test2" method="post" enctype="multipart/form-data">           
                <input type="file" name="test">
                <p>
                <input type="submit" value="Upload File!">
    </form>on the servlet side, i tried using
    String filename = request.getParameter("test") ;but i keep getting a null value for the filename.
    thanks in advance!

    of lots of apache package, like the FileItemFactory
    and ServletFileUpload, even the FileItem class.The package is written for a much wider audience, it is designed to do a lot more than just read the name of the file being uploaded. I don't know if you read their Guide.
    Keep in mind that the solution posted on the other thread was custom written to solve the posters problem, which is a lot more than reading the file name.
    If you want shrunken code, then it's not that difficult:
    package test71;
    import org.apache.commons.fileupload.disk.DiskFileItemFactory;
    import org.apache.commons.fileupload.servlet.ServletFileUpload;
    import org.apache.commons.fileupload.*;
    import javax.servlet.http.*;
    import java.util.List;
    public class AnotherFileUploadServlet extends HttpServlet {
        public void doPost(HttpServletRequest request, HttpServletResponse response) {
            FileItemFactory factory = new DiskFileItemFactory();
            ServletFileUpload upload = new ServletFileUpload(factory);
            List<FileItem> items = null;
            try {
                items = upload.parseRequest(request);
                for (FileItem item : items) {
                    if (!item.isFormField()) {
                        String fileName = item.getName();
                        System.out.println("File Name is: " + fileName);
            } catch (FileUploadException e) {
                e.printStackTrace();
    }

  • Getting filename from a string including filepath and filename

    How I can get a filename from a string which includes both
    filepath and filename? The filepath is not always the same. For
    example, the variable could include a "C:\temp\test.doc" or
    "C:\files\docfiles\test.doc" and I need to get the filename
    "test.doc" and save it to another variable. Thanks in
    advance.

    on getFilenameFromPath vPath
    oldDelim=the itemDelimiter
    the itemDelimiter=the last char of the moviePath
    iFilename=the last item of vPath
    the itemDelimiter=oldDelim
    return iFilename
    end
    Put that into a movie script. Then you can call the function
    any time
    to retrieve the last part of the path- like this:
    put getFilenameFromPath("C:\temp\test.doc")
    -- "test.doc"
    As an added bonus, it is cross-platform so it will work on a
    Mac as well
    as a PC.

  • Unable to get filename from mail to XI to file scenario

    Hi
    How could i get the name of an attachment to be used as the file name on my File Adapter in a Mail to file scenario? 
    I recieve the files as attachments and I have used the payload swap bean to swap my actaull message content to attachment. That works perfect, the contents of the file are saved successfully on my file system.  The file is sent as a plain text file and not xml and no mapping is done, I just get the files from the mail and save them into a file server for further processing.
    Your help will be highly appreciated
    Ronny

    Hi
    I have installed my Module, but when I try to call it from within the adapters I get an error
    exception caught during processing mail message [614]com.sap.aii.af.mp.processor.ModuleProcessorException: Error during processing local bean: localejbs/mailAttachmentFileNames caused by: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of mailAttachmentFileNames.
    I have searched all the logs and the module is active. I even restarted my J2EE engine, twice but still nothing..
    please assist
    Ronny

  • Filename in Attachement payload

    Hy,
    I have to detach an email attachement on my file System.
    That's works but I'm not able to maintain the same filename.
    Can anybody help me.
    Thanks
    Mat

    Hi Mattia,
    If your file name is a part of your email atttachment ( the payload ), then you can dynamically create your file name.
    To do this,in the filename of the receiver file adapter, give the filename a <b>%var%</b>.
    Anything between % is treated as a varibale by XI. Now, under variable name substitution, you will have to give the value of var and this will act as the filename.
    You can access the payload using <b>payload:</b> and the XPATH.
    For info on how to do this, check the topic<b> VARIABLE SUBSTITUTION</b> in this link.
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    hope this helps,
    Regards,
    Bhavesh

  • Get filename from list of measurement files

    Hi,
    I would like to have the user select from a list of measurement files and pass that name and path to the write to measurement file VI.
    Ideally, when the data is written to the measurement file the user could add comments.
    Any ideas?
    Thanks
    Joel

    Hi Joel,
    maybe your questions a too generic?
    To select from a list of files you use the FileDialog (either ExpressVI or plain function) and it will give you a (full) path to the selected file.
    To save "comments" with data you can use TDMS file functions which allow to set "properties" for channels of data.
    To get more help than that you should better describe your problems and it's always a good idea to attach a VI of your tries to solve them...
    Examples are found by the help menu in LabVIEW: simply start the example finder
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Get filename from EBS to BPEL

    Hi to all,
    I have an ESB process that has a file adaptor, that reads xml files from a certain folder and then routes them to a BPEL process.
    I want FROM Bpel to get the filename, becauase i need to store that filename in my database.
    Can anyone please help me?
    Thank you

    Antonis
    Hope this helps. I had wanted to write files and store the filenames in a database table.
    I haven't it, but I am sure it will work for read as well.
    Edit the adapter WSDL to add an output:
    <portType name="Write_ptt">
    <operation name="Write">
    <input message="tns:resultset_msg"/>
    <output message="hdr:OutboundHeader_msg"/>
    </operation>
    </portType>
    then edit die .esbsvc file:
    change the
    mepDisplayName="One Way" mep="OneWay"
    to[b]
    mepDisplayName="Request Response" mep="RequestResponse"
    in the Reply part of the Routing Service you would be able to use call a database adapter or a BPEL process
    Message was edited by:
    user638991

  • Need to get filename from custom extension

    Hello,
    I am currently writing a custom extension and I'm having a tough time trying to get the filename of the document (java file) of the currently selected (and opened) file. So I have a java file open and right click on it to launch my extension. How do I get information on that document?
    Also is there javadocs for the extsnsion API's? If so where are they located.
    Thanks in advance!
    Bill

    Hi Bill,
    You can find javadoc on the extension API via the help system (JDeveloper Extension SDK topic under the Reference section). Alternatively, you can extract the contents of the ${jdevhome}/jdev/doc/ohj/jdev-doc.jar to a directory somewhere to view the javadoc in a browser.
    To get the filename of a document, assuming you're using 10g (not much different from 9.0.x), you need to get an instance of oracle.ide.addin.Context. Normally, you'll have a Context instance because you're implementing your logic in a Controller or a Command subclass. If not, you can obtain one using:
    Ide.getMainWindow().getLastActiveView().getContext()Once you have the context, you can get the current selection from it. If that selection implements oracle.ide.model.Locatable, it has a URL. From the URL, you can get the filename:
    import oracle.ide.model.Element;
    import oracle.ide.model.Locatable;
    import java.net.URL;
    import oracle.ide.net.URLFileSystem;
    Element[] selection = context.getSelection();
    if ( selection != null )
      if ( selection[0] instanceof Locatable )
        URL url = ((Locatable)selection[0]).getURL();
        String filePath = URLFileSystem.getPlatformPathName(
          url
    }One final thing, if the current view is an editor, the selection may be empty or will not contain Locatables. If that's the case, you might want to get the Document from the Context instead. I.e.:
    URL url = context.getDocument().getURL();
    String filePath = URLFileSystem.getPlatformPathName(
      url
    );Thanks,
    Brian
    JDev Team

  • Getting filename from ahref

    Hi guys...
    <a href="<%=retrieveFileFromDatabase%> target="main">Hello!</a>
    I need to get the filename of the file retrieve from database (that is retrieveFileFromDatabase) at the time the user clicks the link but all i get is all the filename of the files retrieve... Not the filename the user click at that time... Any help here? Thanks in advance...

    <a href="<%=(((Recordset1_data =
    Recordset1.getObject(file_doc"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%>"
    target="main" ><%=(((Recordset1_data =
    Recordset1.getObject("topic"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%></a>
    This is the actual code in my program..Okay, got that. First step done.
    I need to get the value, "<%=(((Recordset1_data =
    Recordset1.getObject("file_doc"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%>, once the
    user clicks the link...Right, and that is what the code says, in JSP scriptlet. So you execute this on a page, and the HTML is sent to your browser, and ...
    What Happens? An error? Or it just doesn't give you what you want. For instance, Take a look at the source code, find that link, and see what is there. Compare this to what you think it should look like. For instance, I would guess, what you think should happen is the html should be:
    Topic Of Document
    But what you are actually getting is:
    Topic of Document
    Is this correct?

  • Getting image from attachment into image field in a form

    Hi all,
    I have a process where a customer sends in a PDF with an attached image. This image is then stored in a process variable and I need to put it in another form.
    Any ideas how to do this most efficiently?
    Sincerely
    Kim

    Hi Paul,
    I did what you suggested, here goes in more detail:
    1. I use processFormSubmission for getting the attacment out of the document (might be possible in another way though).
    2. I loop through the list of attachments to get to one I need
    3. When I find it I use "getDocContentBase64(doc)" method and saves to string
    4. I store the string in my xfaform (in a normal textfield)
    5. On the form I have some simple code on initialize that sets the data from the textfield to be assigned to the image field for the image.
    Thats it...simple eh :)
    PS: There is a glitch in the Help for LC 8.2, it says that there is a " getDocFromBase64(aString)" method available, but it is not there...
    Sincerely
    Kim

  • Get filename from Watched folder start point

    I have a watched folder as a start point and I can use the
    symbols %F and %E in order to save the output documents in the Result folder.
    This is easy.
    What I cannot do, is getting in a string variable the same filename in order to use it within the Process:
    Is it possible?
    I would like to exploit this filename to discriminate the activities that the file have to make...
    Thanks you as usual!

    thank you Jasmin, your answer is correct and now it works!
    only I don't understand why my way didn't work...
    Instead of a setValue, I used directly a INSERT SQL activity with getDocAttribute(/process_data/@docXML, "basename") as parameter: as is, it didn't work!
    As you suggest, if I put a setValue between the Watched folder startpoint and the INSERT SQL activity (now with the populated string as parameter), it works...
    Bah!
    Thank you again!
    Fabio

  • Get filename from uploaded file then place in input tags

    i have an upload feature with the use of upBean and i can get the filname thru filename=file.getFileName
    when i place in the input tags it takes an error what i suppose to do
    <input type="hidden" name="getfilename" value="<%=filename%>">
    if (MultipartFormDataRequest.isMultipartFormData(request)) {
                            // Uses MultipartFormDataRequest to parse the HTTP request.
                            MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
                            String todo = null;
                            String filename=null;
                            String description=request.getParameter("txtDesc");
                            String checkfilename=mrequest.getParameter("uploadfile");
                            if (mrequest != null) todo = mrequest.getParameter("todo");
                            if ( (todo != null) && (todo.equalsIgnoreCase("upload")) ) {
                                Hashtable files = mrequest.getFiles();
                                if ( (files != null) && (!files.isEmpty()) && (description!=null)) {
                                    UploadFile file = (UploadFile) files.get("uploadfile");
                                    if (file != null){
                                        filename=file.getFileName();                                    if(checkfilename==null){
                                            filename="";
                                  upBean.store(mrequest, "uploadfile");  // Uses the bean now to store specified by jsp:setProperty at the top.
                                             else out.println("<BR> todo="+todo);
                    %>
                    Message was edited by:
    BlingBling15

    Thanks for reply.
    I replaced messageFileUpload (binded to blob table column) with messageStyledText (binded to filename attribute). Above the table placed single messageFileUpload and submitButton nearby. After user select file on submit I do:
    *if (pageContext.getParameter("DoUploadButton") != null) {*
    .. DataObject fileUploadData = pageContext.getNamedDataObject("FileData");
    .. *if (fileUploadData != null) {*
    .... String fileName = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_NAME");
    .... String contentType = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");
    .... BlobDomain fileContent = (BlobDomain)fileUploadData.selectValue(null, fileName);
    .... String seqNumber = pageContext.getParameter("seqNumber");
    .... am.insertInstanceAttachRowBlob(seqNumber, fileName, fileContent, contentType);
    .... pageContext.removeNamedDataObject("FileData");
    .. return;
    Edited by: user12086842 on 02.01.2013 2:41

Maybe you are looking for

  • File Attachment in Sandboxed Solution

    I was using below code to insert item in the list with the file attachement using farm solution <asp:TextBox ID="txtBoxTitle" runat="server"></asp:TextBox> <asp:FileUpload ID="flUpload" runat="server" /> <asp:Button ID="btnSave" runat="server" Text="

  • Hi where to specify in XI about the target system

    Hi! I have a j2EE application(servlet) that receives XML file from XI. Where should i specify in XI about this? Its urgent. Your help is greatly rewarded. Thanks

  • What is the best way to reconcile gl account postings with pay results ?

    Hi experts what is the best way to reconcile gl account postings with pay results ? is it running wage type reporter ? or is there any otehr way .. i have variances in wtr n gl posting for a few employees. Regards

  • PO output type or userexit or enhancement point

    Hi Experts, We have configured the output type in Nace for sending print out with periodically scheduling job. In our SAP all Po's must be create automatically...... But new requirement is ....if PO created manually through ME21n then print out shoul

  • Billing value in milestone billing exceeds net value.

    Dear all Sap Gurus,                         I have a situation where in my Sales Order i booked 10 quantities for an item with item category Tao,with each having value of Rs 1000. So net value for the item is Rs 10000. Now in billing plan my client b