Try this
http://www.infopathdev.com/blogs/ernesto/archive/2012/01/13/extract-attachments-from-your-infopath-forms.aspx
As far as I know, there isn't anything built into either SharePoint or InfoPath to do this; you would have to write code. Take a look at this article http://support.microsoft.com/kb/892730 for
how to decode the base64 encoded string of an attachment. If you're using VB.NET, you can take a look at this InfoPath newsgroup threadhttp://groups.google.com/group/microsoft.public.infopath/browse_thread/thread/310fca090e9f708f/81376114cd5ee732?hl=en&lnk=gst&q=attachment+disk+infopath#81376114cd5ee732
Once you've decoded the attachment, you can use either the WebClient class (if you're extracting from outside of SharePoint) or classes of the SharePoint Object Model (if you're extracting from somewhere inside of SharePoint) to upload the binary data
as a file to a SharePoint document library.
There are several ways to retrieve the form and extract the attachment; it all depends on your requirements and at which moment you want to do the extraction. You could use for example an ItemAdded event handler in SharePoint on the form library to do the extraction
as soon as the form has been added to the form library. You could also extract after the fact by creating a utility program (outside of SharePoint) that would retrieve all forms in a form library and do the extraction.