Re: Error with Html code
- From: kosov@xxxxx (Eugene Kosov)
- Date: Tue, 29 May 2007 17:18:01 +0400
Alma Tirkey wrote:
I have a problem with uploading a files in apache webserver.
Its not giving me an error but i am not getting the desired result
what i want. My requirement is to save only the pdf files to the a
directory .
what i am testing is how to get only the filename .
#!/usr/bin/perl use CGI;
my $q = new CGI; my $filepath = $q->param('photo');
#$filepath = '/u/test/global/filename.txt'; my ( @data ) = split
/\//, $filepath; my ( $filename ) = $data[$#data]; print "$filename"
; ## will print filename.txt
upload.html <html> <body> <form action="/cgi-perl/file_path.pl"
method="post" enctype="multipart/form-data"> Photo to Upload: <input
type="file" name="photo"/><br><br> Your Email Address: <input
type="text" name="email_address"/><br><br> <input type="submit"
name="Submit" value="Submit Form"/> </form> </body> </html>
i am getting an error in my log : [Tue May 29 17:47:52 2007] [error]
[client ::1] malformed header from script. Bad
header=intro_modules.pdf: file_path.pl, referer: http://localhost/cgi-perl/load.html [Tue May 29 17:47:52 2007] [warn]
/cgi-perl/file_path.pl did not send an HTTP header
where am i going wrong.
help will be of great relief to me. Thanks & regards, Alma
Your problem is web-server configuration. It thinks that upload.html is a perl script an tries to execute it with perl interpreter.
As I told before, you should post us your apache configs or we can't tell you what is wrong in you web-server configuration.
P.S. Do not forget to reply to list as well.
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature
- References:
- Error with Html code
- From: Alma
- Error with Html code
- Prev by Date: Re: Error with Html code
- Next by Date: if (<FH>) VS while (<FH>)
- Previous by thread: Re: Error with Html code
- Next by thread: Re: Error with Html code
- Index(es):