Tempfile doesn't allow block operations, plus they were using the wrong scope.
Still not sure if I should have to change the custompath so that it is a barename (no path or extension)
I think this should work.