Reputation: 13
I have a BizTalk FTP receive location. And sometimes facing a problem of zero byte sized file. When we said our partners you send us empty files, they don't accept this. And as a solution a want to add a filter to our FTP receive location to check whether file size greater than zero. I want to get files if size of file greater than zero.
Upvotes: 1
Views: 188
Reputation: 11527
It is possible that your FTP is picking up files before they are fully written, what you need to do is get the process that is writing the file to either use a temporary file name or folder and to do a Rename or Move after it is completely written.
If they are genuinely writing zero byte files, then a custom pipeline component as per Pieter's answer or if the FTP Location is local, make it into a file share and change to the File adapter, that automatically discards zero byte files.
Upvotes: 0
Reputation: 3266
One way you could solve this is to create a custom pipeline component.
This component would check the length of the stream. In case the stream is empty (length 0) or whatever you would consider to expect if you receive an empty file, you could return null for the message.
That way, your message will be dropped in your component (within your pipeline) without having any impact in case a non-empty file is received and processed.
Upvotes: 1