fix exception caused by empty attachment file
set empty attachment file size as 0
fix param error
add end to fix error