Hello ,
Есть следующий скрипт:
#!/usr/bin/perl
use CGI;
$path_to_foto='/usr/home/navigatortour/www/rus/';
$rel_path_to_foto='/rus/';
$a=new CGI;
print $a->header('text/html;charset=windows-1251');
print "<html>\n";
print '<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"></head>';
print "<body bgcolor=silver link=maroon vlink=gray alink=red text=black>\n";
# ......... ...... ..
#
#
foreach $i ($a->param){
my($v)=$a->param($i);
$v=~s/<[^>]+>//g;
$MD{$i}=$v;
}
#
# .......... .......... foto1
#
$savefile='name';
$filename=$MD{'img'};
$filename=~/.+\.(.+)/;
$savefile.=".$1";
$savefile=$path_to_foto.$savefile;
open(SAVE,">$savefile");
binmode(SAVE);
while ($temp=read($filename,$buffer,1024)) {
print SAVE $buffer;
}
chmod(0666,SAVE);
close(SAVE);
#
# ... ......
#
$savefile=~/.+\/(.+\..{3,4})\b/;
$savefile=$rel_path_to_foto.$1;
$savefile="<img src=$savefile>";
print $savefile;
Если с помощью него на сервер передать GIF файл, то файл приходит
битый. В чем может быть причина?
Best regards,
Alexander Isaev mailto:A.Isaev@xxxxxxxxxx
=============================================================================
= Apache-Talk@xxxxxxxxxxxxx mailing list =
Mail "unsubscribe apache-talk" to majordomo@xxxxxxxxxxxxx if you want to quit.
= Archive avaliable at http://www.lexa.ru/apache-talk =
"Russian Apache" includes software developed
by the Apache Group for use in the Apache HTTP server project
(http://www.apache.org/) See
Apache LICENSE.
Copyright (C) 1995-2001 The Apache Group. All rights reserved.
Copyright (C) 1996 Dm. Kryukov; Copyright (C)
1997-2009 Alex Tutubalin. Design (C) 1998 Max Smolev.