delete file if it exists and use inputstream directly