You need to make sure that you transferred the file in Ascii mode and not Binary mode as Ascii mode is for transfer of text files and binary is for images. Consult your FTP program's documentation on how to manipulate transfer modes. Also, you will have to make sure that the CGI script's permissions are set as executable. This can be done via FTP or SSH/Telnet.