By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,850 Members | 1,269 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,850 IT Pros & Developers. It's quick & easy.

help on perl file uploading

rajiv07
100+
P: 141
Hi to all

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2.  
  3. print "Content-type:text/plain\n\n";
  4.  
  5. print "Hello, World...\n";
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
Feb 20 '08 #1
Share this Question
Share on Google+
4 Replies


KevinADC
Expert 2.5K+
P: 4,059
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.
Feb 20 '08 #2

rajiv07
100+
P: 141
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.
Feb 20 '08 #3

Kelicula
Expert 100+
P: 176
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?
Feb 20 '08 #4

rajiv07
100+
P: 141
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
Feb 21 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.