+ GnomeVFSFileInfo *info;
+ char *mime_type;
+ GnomeVFSResult result;
+
+ info = gnome_vfs_file_info_new ();
+ result = gnome_vfs_get_file_info (uri, info,
+ GNOME_VFS_FILE_INFO_GET_MIME_TYPE |
+ GNOME_VFS_FILE_INFO_FORCE_SLOW_MIME_TYPE |
+ GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
+ if (info->mime_type == NULL || result != GNOME_VFS_OK) {
+ mime_type = NULL;
+ } else {
+ mime_type = g_strdup (info->mime_type);
+ }
+ gnome_vfs_file_info_unref (info);
+
+ return mime_type;
+}