Index: sources/rb-removable-media-source.c
===================================================================
--- sources/rb-removable-media-source.c	(revision 5747)
+++ sources/rb-removable-media-source.c	(working copy)
@@ -517,7 +517,8 @@
 					  const char *extension)
 {
 	RBRemovableMediaSourceClass *klass = RB_REMOVABLE_MEDIA_SOURCE_GET_CLASS (source);
-	char *uri;
+	char *uri = NULL;
+	char *sane_uri = NULL;
 
 	if (klass->impl_build_dest_uri) {
 		uri = klass->impl_build_dest_uri (source, entry, mimetype, extension);
@@ -525,6 +526,11 @@
 		uri = NULL;
 	}
 
+	sane_uri = rb_sanitize_uri_for_filesystem(uri);
+	g_return_val_if_fail(sane_uri != NULL, NULL);
+	g_free(uri);
+	uri = sane_uri;
+
 	rb_debug ("Built dest URI for mime='%s', extension='%s': '%s'",
 		  mimetype,
 		  extension,
Index: lib/rb-util.c
===================================================================
--- lib/rb-util.c	(revision 5747)
+++ lib/rb-util.c	(working copy)
@@ -376,6 +376,44 @@
 	return mount_point;
 }
 
+gchar *
+rb_uri_get_filesystem_type(const char *uri)
+{
+	GnomeVFSVolume *volume = NULL;
+	GnomeVFSVolumeMonitor *monitor = NULL;
+	gchar *mount_point_uri = NULL, *mount_point_path = NULL;
+	gchar *fstype = NULL;
+	GError *error = NULL;
+	
+	g_return_val_if_fail(uri != NULL, NULL);
+
+	monitor = gnome_vfs_get_volume_monitor ();
+	g_return_val_if_fail(monitor != NULL, NULL);
+
+	mount_point_uri = rb_uri_get_mount_point(uri);
+	g_return_val_if_fail(mount_point_uri != NULL, NULL);
+	
+	mount_point_path = g_filename_from_uri(mount_point_uri, NULL, &error);
+	if (error) {
+		g_warning("%s", error->message);
+		g_error_free(error);
+		return NULL;
+	}
+	g_return_val_if_fail(mount_point_path != NULL, NULL);
+
+	volume = gnome_vfs_volume_monitor_get_volume_for_path(monitor, mount_point_path);
+	g_free(mount_point_path);
+	g_free(mount_point_uri);
+
+	g_return_val_if_fail(volume != NULL, NULL);
+
+	fstype = gnome_vfs_volume_get_filesystem_type(volume);
+	
+	gnome_vfs_volume_unref(volume);
+	
+	return fstype;
+}
+
 gboolean
 rb_uri_is_mounted (const char *uri)
 {
Index: lib/rb-file-helpers.c
===================================================================
--- lib/rb-file-helpers.c	(revision 5747)
+++ lib/rb-file-helpers.c	(working copy)
@@ -43,6 +43,7 @@
 
 #include "rb-file-helpers.h"
 #include "rb-debug.h"
+#include "rb-util.h"
 
 static GHashTable *files = NULL;
 
@@ -1269,3 +1270,46 @@
 	}
 }
 
+char *
+rb_sanitize_uri_for_filesystem(gchar *uri)
+{
+	gchar *filesystem = rb_uri_get_filesystem_type(uri);
+	gchar *sane_uri = NULL;
+
+	if (!filesystem)
+		return g_strdup(uri);
+
+	if (!strcmp(filesystem, "fat") ||
+	    !strcmp(filesystem, "vfat") ) {
+	    	gchar *hostname = NULL;
+		GError *error = NULL;
+	    	gchar *full_path = g_filename_from_uri(uri, &hostname, &error);
+
+		if (error) {
+			g_error_free(error);
+			g_free(filesystem);
+			g_free(full_path);
+			return g_strdup(uri);
+		}
+
+		g_strdelimit (full_path, "\"", '\'');
+		g_strdelimit (full_path, ":|<>*?\\", '_');
+
+		/* create a new uri from this */
+		sane_uri = g_filename_to_uri(full_path, hostname, &error);
+
+		g_free(hostname);
+		g_free(full_path);
+
+		if (error) {
+			g_error_free(error);
+			g_free(filesystem);
+			return g_strdup(uri);
+		}
+	}
+
+	/* add workarounds for other filesystems limitations here */
+
+	g_free(filesystem);
+	return sane_uri ? sane_uri : g_strdup(uri);
+}
Index: lib/rb-util.h
===================================================================
--- lib/rb-util.h	(revision 5747)
+++ lib/rb-util.h	(working copy)
@@ -55,6 +55,8 @@
 GtkWidget *rb_image_new_from_stock (const gchar *stock_id, GtkIconSize size);
 
 gchar *rb_uri_get_mount_point (const char *uri);
+gchar *rb_uri_get_filesystem_type(const char *uri);
+
 gboolean rb_uri_is_mounted (const char *uri);
 
 
Index: lib/rb-file-helpers.h
===================================================================
--- lib/rb-file-helpers.h	(revision 5747)
+++ lib/rb-file-helpers.h	(working copy)
@@ -79,6 +79,8 @@
 void		rb_file_helpers_init	(void);
 void		rb_file_helpers_shutdown(void);
 
+char *		rb_sanitize_uri_for_filesystem(gchar *uri);
+
 G_END_DECLS
 
 #endif /* __RB_FILE_HELPERS_H */
