Hi,
As I understand, you want to view the attachments uploaded in the InfoPath form in the browser.
Do you just add the file attachment control in InfoPath form? Or do you add the code to custom the file attachment control? Could you please provide more details about how you upload the file?
You also should go to the central administration to set for viewing the attachments in the browser. You could go to central administration->manage web applications, select the web application you want to set, click the general settings in the ribbon and
select the general settings, scroll down to Browser File Handling and select the permission.
If you select the strict, Strict specifies the MIME types which are not listed in a Web Applications AllowedInlineDownloadedMimeTypes property (more on this in a bit) are forced to be downloaded.
If you select the permission, Permissive specifies that the HTML and other content types which might contain script are allowed to be displayed directly in the browser. In other words, no matter what the type of content, if it lives within SharePoint,
the file will open in your browser.
The article below is about SharePoint: Browser File Handling Deep Dive.
http://social.technet.microsoft.com/wiki/contents/articles/8073.sharepoint-browser-file-handling-deep-dive.aspx
Best regards,
Sara Fan