code: func (c *Client) Upload(ctx context.Context, src io.Reader, dst string, p soap.Upload, attr types.BaseGuestFileAttributes, force bool) error {
  	vc := c.ProcessManager.Client()
  
  	var err error
  
  	if p.ContentLength == 0 { // Content-Length is required
  		switch r := src.(type) {
  		case *bytes.Buffer:
  			p.ContentLength = int64(r.Len())
  		case *bytes.Reader:
  			p.ContentLength = int64(r.Len())
  		case *strings.Reader:
  			p.ContentLength = int64(r.Len())
  		case *os.File:
  			info, serr := r.Stat()
  			if serr != nil {
  				return serr
  			}
  
  			p.ContentLength = info.Size()
  		}
  
  		if p.ContentLength == 0 { // os.File for example could be a device (stdin)
  			buf := new(bytes.Buffer)
  
  			p.ContentLength, err = io.Copy(buf, src)
  			if err != nil {
  				return err
  			}
  
  			src = buf
  		}
  	}
  
  	url, err := c.FileManager.InitiateFileTransferToGuest(ctx, c.Authentication, dst, attr, p.ContentLength, force)
  	if err != nil {
  		return err
  	}
  
  	u, err := c.FileManager.TransferURL(ctx, url)
  	if err != nil {
  		return err
  	}
  
  	return vc.Client.Upload(ctx, src, u, &p)
  }
docs: // Upload transfers a file to the guest