Issue refs #1598: fixed bug with upload to other domain