Upload lines to server
Improve line upload handling