Hooch
Hooch

Reputation: 29693

FILE Receive Location - How to define file mask with 2 extensions

I would like to only get files ending with *.xls OR *.xlsx extension from my Receive Location. How should "File mask" look like?

Upvotes: 3

Views: 2884

Answers (3)

Christian Stærk
Christian Stærk

Reputation: 66

I have not personally tested that BizTalk only uses the first 3. charaters, but if so, this is probably a dangerous solution, since it might be addressed in future hotfixes.

I would suggest creating two receive locations, one for each filter, and bind them to the same receive port. This is also more future-proof since you can add any number of folders or file types. And that is basically the design idea behind ReceivePorts and -locations.

If you are using orchestrations, these are bound to the Receive Port anyway and you do not need to make any changes for this to work. If this is a messaging only scenario, you just need to make sure that your subscriptions/filters are not based on the name of the receive location and you are fine.

Upvotes: 5

Vikas Bhardwaj
Vikas Bhardwaj

Reputation: 1510

File adapter uses three chars only for extension, so even if you give *.xlsx it will pick both *.xls and *.xlsx file. You don't need to do anything in yr case just use *.xlsx for file mask

Upvotes: 3

Jeroen Maes
Jeroen Maes

Reputation: 673

This is not possible with a single Receive Location:

Only one file mask or file name can be specified per receive location or send port.

See MSDN: Restrictions on the File Mask and File Name Properties

However, you can use the File Adapter SDK Sample and build your own Adapter to use a regular expression as described in this blogpost.

Upvotes: 1

Related Questions