fix curl backward compatibility bug, create output dir if dont exist.