Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Using incoming filename
- This topic has 2 replies, 1 voice, and was last updated 9 years, 2 months ago by
community-content.
-
AuthorPosts
-
-
July 12, 2006 at 7:44 AM #15029
Hi,
Just after the receive shape, I’m using an [i:b73c94e9a3]Expression[/i:b73c94e9a3] shape in my orchestration and here I need the incoming file name like this :
[code:1:b73c94e9a3]fileName = incomingMsg(FILE.ReceivedFileName);[/code:1:b73c94e9a3]
Then, I would like to use a [i:b73c94e9a3]Decide[/i:b73c94e9a3] shape to test if this file already exists in the BizTalk Server directory (\”c:\\data\\\” + [color=red:b73c94e9a3]filename[/color:b73c94e9a3]).
[code:1:b73c94e9a3]System.IO.File.Exists(@\"c:\\data\\\"+fileName)[/code:1:b73c94e9a3]
I have the following error :[i:b73c94e9a3][b:b73c94e9a3]The given path’s format is not supported[/b:b73c94e9a3][/i:b73c94e9a3]
So the test always returns false even if the file already exists.
However, I can use the filename in the [i:b73c94e9a3]Message Assignement[/i:b73c94e9a3] shape because the output file named just like [color=red:b73c94e9a3]filename[/color:b73c94e9a3] :
[code:1:b73c94e9a3]outputMsg(FILE.ReceivedFileName) = fileName;[/code:1:b73c94e9a3]
[i:b73c94e9a3]Ex. Incoming file = coura38.fic – Output file = coura38.fic
If the file coura38.fic already exists in \”c:\\data\\\” the orchestration terminated.
[/i:b73c94e9a3]
It would be great if someone could tell me why this doesn’t work…-
July 12, 2006 at 9:34 AM #15030
Actually :
[code:1:a7cd7e0c6a]incomingMsg(FILE.ReceivedFileName);[/code:1:a7cd7e0c6a]
return a string lke this :
[code:1:a7cd7e0c6a]c:\\data\\file[/code:1:a7cd7e0c6a]
and not only like I thought :
[code:1:a7cd7e0c6a]file[/code:1:a7cd7e0c6a]
[size=9:a7cd7e0c6a]Sorry to disturb the forum…[/size:a7cd7e0c6a]
-
-
July 12, 2006 at 4:26 PM #15028
When you receive a message via the file adapter, the File.ReceivedFileName property has the full path of the received file.
If you want just the file name, you can parse it like this System.Path.GetFileName(File.ReceivedFileName).
Never tried that code inside an Orchestation though – you might need to do it insdie a helper .net componet and return the file name.
Hope this helps.
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.