Commit bf1c9d877fa3cf2c57ab469f6f092c679276a329
1 parent
a53338dc
Exists in
master
and in
7 other branches
Opção de download de shapefile no formulário de manutenção de regiões do sistema…
… metaestat. Correção na geração de arquivos zip
Showing
4 changed files
with
6 additions
and
3 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin/php/classe_metaestat.php
... | ... | @@ -2128,7 +2128,7 @@ class Metaestat{ |
2128 | 2128 | foreach($dados["colunas"] as $t){ |
2129 | 2129 | $temp = strtoupper($t["field"]); |
2130 | 2130 | if(strlen($temp) > 10){ |
2131 | - $temp = substr($t["field"],0,8).($cni++); | |
2131 | + $temp = substr($temp,0,8).($cni++); | |
2132 | 2132 | } |
2133 | 2133 | if($t["type"] == "varchar" || $t["type"] == "char" || $t["type"] == "character varying" || $t["type"] == "character" || $t["type"] == "text"){ |
2134 | 2134 | $def[] = array($temp,"C","254"); | ... | ... |
admin/php/metaestat.php
... | ... | @@ -1441,6 +1441,7 @@ switch (strtoupper($funcao)) |
1441 | 1441 | fclose($handle); |
1442 | 1442 | |
1443 | 1443 | $ziper = new zipfile(); |
1444 | + | |
1444 | 1445 | $ziper->addFile($contentsshp, basename($shp).'.shp'); |
1445 | 1446 | $ziper->addFile($contentsshx, basename($shp).'.shx'); |
1446 | 1447 | $ziper->addFile($contentsdbf, basename($shp).'.dbf'); | ... | ... |
pacotes/kmlmapserver/classes/zip.class.php
... | ... | @@ -95,7 +95,9 @@ class zipfile |
95 | 95 | */ |
96 | 96 | function addFile($data, $name, $time = 0) |
97 | 97 | { |
98 | - $name = str_replace('\\', '/', $name); | |
98 | + //adicionado por edmar moretti | |
99 | + $data = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$data); | |
100 | + $name = str_replace('\\', '/', $name); | |
99 | 101 | |
100 | 102 | $dtime = dechex($this->unix2DosTime($time)); |
101 | 103 | $hexdtime = '\x' . $dtime[6] . $dtime[7] |
... | ... | @@ -219,7 +221,7 @@ class zipfile |
219 | 221 | */ |
220 | 222 | function output($file) |
221 | 223 | { |
222 | - $fp=fopen($file,"w"); | |
224 | + $fp=fopen($file,"wb"); | |
223 | 225 | fwrite($fp,$this->file()); |
224 | 226 | fclose($fp); |
225 | 227 | } | ... | ... |