added file uploading, encoding