improve document
add beforeUpload hook, and adjust codes