Fix #1324

Add error when uploading an empty file.
#1324