Using File.ReceivedFilename

Home Page Forums BizTalk 2004 – BizTalk 2010 Using File.ReceivedFilename

Viewing 1 reply thread
  • Author
    Posts
    • #12877

      Can I get only the filename with the extension without the absolute path using File.ReceivedFilename?

      Eg:

      C:\\myfolder\\xyz.xml

      I need only xyz.xml in the orchestration.

      Is it possible ?

    • #12878

      thanks !!

      • #12879

        You can always get the full file name and do some string manipulation either inside the Pipeline or Orchestration.

        I think I do something like in this sample: https://www.biztalkgurus.com/Samples/Naming-Output-Files-Orchestration.html

        Best of luck.

        • #12880

          I don’t think it’s possible, but the System.IO.Path class can help you.

          See this help topic in Visual Studio:

          ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfsystemiopathclasstopic.htm

          Here’s the C# code which should work with slight modifications in an Expression shape (exept for the Console.WriteLine and define the variables in Orch View)

          string myfilename = @\”C:\\dir\\subdir\\file1.xml\”;
          string fileonly = System.IO.Path.GetFileName(myfilename);
          Console.WriteLine (\”Output: File=\” + fileonly);

          Output: File=file1.xml

          Neal Walters
          http://Biztalk-Training.com – Self-Training Videos

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.