I had the same problem with Agni Reddy's instructions. It worked great till I got to the end and the code was in C Sharp. I'm running InfoPath out of the Office Suite, so I can only use Javascript or VB Script. I fooled around with it a little bit, though, and was able to come up with a workable equivalent in Javascript. Here's what I came up with:
function deleteFile(fileName)
{
XDocument.GetDOM("UpdateListItemsConfig").selectSingleNode("/UpdateListItemsConfig/SharepointDelete/Batch/Method/Field[@Name = 'FileRef']").text = fileName;
XDocument.DataAdapters("SharePointDelete").Submit();
}
I should mention that not only am I green when it comes to SharePoint and InfoPath, but also Javascript and XML, so this solution might be horrendously inelegant for all I know, but it works, so I thought I'd pass it along.