It seems to me version 3.1.1 does not work well on .764. The mediashare_media table has a not-null storagetype field. That field is not generated under .764 db API therefore the StoreMediaItem function throws an error an no media can be uploaded. I 'bypassed' this problem allowing null content in the storagetype field.