fix crash when uploading non-media file

closes #341
config.js for plain operation
simpler config after permissions rework