File managing on server side.

moving files from tmp folder to user folder after send function. Forming
json string for files and direct links

need to make db insertion.