Fixed SQL escaping
Fixed problem with repeatedly uploading the same file