Moved html upload code to its own file.