Fix bug with upload. Check for condition eof
Merge pull request #71 from torhve/fix-upload

Fix bug with upload. Check for condition eof