Karolis Skripka fixed file upload and sql error