Where are you trying to publish the gallery???
Firstly, have you entered the correct FTP settings as given by the host where you are uploading to?
Next, try using Export and then uploading via an external FTP program like Filezilla. FTP from Lightroom isn't as robust as a dedicated FTP program.