Fix attachment upload body corruption
Add attachment test example