add resize file function