Create an Excel file based on the infopath form and upload it to the specified document library in Sharepoint.
Create Document Library
Spsite site =NewSpsite (siteurl); splistitem item= Site. allwebs ["website name"]. Lists ["List name"]. Folders. Add ("Document Library URL", Spfilesystemobjecttype. folder); item ["Name"] = Your folder name; Site. rootweb. allowunsafeupdates=True; Item. Update (); site. rootweb. allowunsafeupdates=False;
Upload a file to a specified document library
Filestream FS =NewFilestream (direct, filemode. Open, fileaccess. Read); binaryreader br=NewBinaryreader (FS); byte [] filecontents= Br. readbytes ((Int) Fs. Length); br. Close (); FS. Close (); spfolder folder= Site. rootweb. getfolder ("Document Library URL");StringFoldername = URL of the uploaded document;Site. rootweb. allowunsafeupdates=True;
Spfile sofle= Folder. Files. Add (Foldername, filecontents,True);
site. rootweb. allowunsafeupdates = false ;