[http] Improve upload file api.

If query string "ret-json=1" is added to the file upload link,
the API will return a json format result. The format of the
result is:
[{'name': 'file1', 'id': 'id1'}, {'name': 'file2', 'id': 'id2'}]

If file with the same name exists, the uploaded file will be renamed.
In such cases, the new name will be included in the json.