Http write file functions