insert/update and select asset on upload

fixes #408
also correct string conversion for empty-check #466