help on perl file uploading

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajiv07
    New Member
    • Jun 2007
    • 141

    help on perl file uploading

    Hi to all

    [CODE=perl]#!/usr/bin/perl

    print "Content-type:text/plain\n\n";

    print "Hello, World...\n";[/CODE]

    This is a testing code which i upload into the Linux Centos webserver.It gives Premature end of script header error.Actually i am working on Windows platform and upload in to Linux Centos webserver.So the same file if i go directly to Linux centos server and do edit using picco and save it without any changes then its working fine.

    Could u anybody List out What might be a problem

    Thanks
    Rajiv
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    Transfer the file from your Windows PC to the server using an FTP program and transfer the file in ASCII (text) mode. If you do not know how read the help files of your FTP program for "transfer mode". The Windows line endings are probably messing up the script when posted to the server, but using the FTP program and transfering in ASCII mode will fix that.

    Comment

    • rajiv07
      New Member
      • Jun 2007
      • 141

      #3
      Originally posted by KevinADC
      Transfer the file from your Windows PC to the server using an FTP program and transfer the file in ASCII (text) mode. If you do not know how read the help files of your FTP program for "transfer mode". The Windows line endings are probably messing up the script when posted to the server, but using the FTP program and transfering in ASCII mode will fix that.
      Thanks Kevin

      Usually I upload the file using FTP program in ASCII mode.Is any other option for this problem.

      Comment

      • Kelicula
        Recognized Expert New Member
        • Jul 2007
        • 176

        #4
        Originally posted by rajiv07
        Thanks Kevin

        Usually I upload the file using FTP program in ASCII mode.Is any other option for this problem.
        Is the server configured to "serve" plain text mime type?

        Otherwise, that script should work.

        I tried it on my Apache 2.2, and on command line.
        No problems...

        Are you sure the ftp client is set properly?

        Comment

        • rajiv07
          New Member
          • Jun 2007
          • 141

          #5
          Originally posted by Kelicula
          Is the server configured to "serve" plain text mime type?

          Otherwise, that script should work.

          I tried it on my Apache 2.2, and on command line.
          No problems...

          Are you sure the ftp client is set properly?
          Thanks Kelicula

          The ftp has not set properly.Now its working fine.

          Regards
          Rajiv

          Comment

          Working...