fix for ReferenceError: event is not defined

Fix for JS error which appears on upload.