modify uploadedFileHandler
Fix some bugs.
Fix a bug that caused by uploading csv files in Firefox.
Fix a bug that if the database is empty, the backend will throw an index
exception
Resolve conflicts.