--- wysiwyg.module	2008-12-01 15:32:41.000000000 +0100
+++ wysiwyg_edit.module	2009-02-08 20:42:26.000000000 +0100
@@ -7,6 +7,13 @@
  */
 
 /**
+ * Implementation of hook_perm().
+ */
+function wysiwyg_perm() {
+  return array('upload files');
+}
+
+/**
  * Implementation of hook_menu().
  */
 function wysiwyg_menu() {
@@ -18,10 +25,27 @@ function wysiwyg_menu() {
     'access arguments' => array('administer filters'),
     'file' => 'wysiwyg.admin.inc',
   );
+  $items['wysiwyg_upload'] = array(
+    'page callback' => 'wysiwyg_upload',
+    'access arguments' => array('upload files'),
+    'type' => MENU_CALLBACK
+  );
   return $items;
 }
 
 /**
+ * Upload callback for all editors.
+ */
+function wysiwyg_upload($editor, $theme = '', $format = '') {
+  $info = wysiwyg_get_editor($editor);
+  if ($info['installed'] && $info['upload callback'] && function_exists($info['upload callback'])) {
+    $func = $info['upload callback'];
+    $func($theme, $format);
+  }
+  exit(0);
+}
+
+/**
  * Implementation of hook_theme().
  */
 function wysiwyg_theme() {
