Improve mktemp, remove contentType in some ajax posts