This duplicates logic from clipbardadmin.ClipboardAdmin.ajax_upload

However, since this is a fork and we probably don't want to touch existing code to much... Dunno... It's up to you whether you want to extract a function or not...