Sorry for the delay in response, but I'm trying to find a way to achieve the results you are looking for, but it seems that the images need to have the "/" in the beginning to be a site relative urls.
The only way we can achieve this by stripping of the leading "/~url" before saving to the database but again we come to the issue of the image not showing in the editor.
i think web_assist_mail157665 have the upload working correct and the images are shown in the HTMLEditor but he is trying to export the local database and import it to the live database and in that case the path to the images are not matching. because locally the path starts with "/~user" and on the server the path should be "/~folder".
I will keep looking into this issue and see if i can find a solution for this problem.