Commit faad436d75aead960fe49b09475eb99839ae5236
1 parent
d68ef852
Exists in
master
and in
7 other branches
Correção nas ferramentas de upload
Showing
5 changed files
with
7 additions
and
7 deletions
Show diff stats
admin/php/estat_mapa_upload.php
@@ -28,7 +28,7 @@ if (isset($_FILES['uploadimagem']['name'])){ | @@ -28,7 +28,7 @@ if (isset($_FILES['uploadimagem']['name'])){ | ||
28 | //sobe arquivo | 28 | //sobe arquivo |
29 | $Arquivo = $_FILES['uploadimagem']['tmp_name']; | 29 | $Arquivo = $_FILES['uploadimagem']['tmp_name']; |
30 | //echo $Arquivo; | 30 | //echo $Arquivo; |
31 | - $status = move_uploaded_file($Arquivo,$arq); | 31 | + $status = move_uploaded_file($Arquivo,str_replace(".png","",$arq).".png"); |
32 | if($status != 1) | 32 | if($status != 1) |
33 | {echo "<p class='paragrafo' >Ocorreu um erro no envio do arquivo. Verifique as permissoes de escrita";exit;} | 33 | {echo "<p class='paragrafo' >Ocorreu um erro no envio do arquivo. Verifique as permissoes de escrita";exit;} |
34 | if($status == 1){ | 34 | if($status == 1){ |
admin/php/metaestat_mapa_uploadimagem.php
@@ -32,12 +32,11 @@ if (isset($_FILES['uploadimagem']['name'])){ | @@ -32,12 +32,11 @@ if (isset($_FILES['uploadimagem']['name'])){ | ||
32 | //sobe arquivo | 32 | //sobe arquivo |
33 | $Arquivo = $_FILES['uploadimagem']['tmp_name']; | 33 | $Arquivo = $_FILES['uploadimagem']['tmp_name']; |
34 | //echo $Arquivo; | 34 | //echo $Arquivo; |
35 | - $status = move_uploaded_file($Arquivo,$arq); | 35 | + $status = move_uploaded_file($Arquivo,str_replace(".png","",$arq).".png"); |
36 | if($status != 1) | 36 | if($status != 1) |
37 | {echo "<p class='paragrafo' >Ocorreu um erro no envio do arquivo. Verifique as permissoes de escrita";exit;} | 37 | {echo "<p class='paragrafo' >Ocorreu um erro no envio do arquivo. Verifique as permissoes de escrita";exit;} |
38 | if($status == 1){ | 38 | if($status == 1){ |
39 | echo "<p class='paragrafo' >Arquivo enviado.</p>"; | 39 | echo "<p class='paragrafo' >Arquivo enviado.</p>"; |
40 | - chmod($arq,0777); | ||
41 | } | 40 | } |
42 | else{ | 41 | else{ |
43 | echo "<p class='paragrafo' >Erro ao enviar o arquivo.</p>"; | 42 | echo "<p class='paragrafo' >Erro ao enviar o arquivo.</p>"; |
admin/php/metaestat_uploadcsv_submit.php
@@ -38,7 +38,7 @@ if (ob_get_level() == 0) ob_start(); | @@ -38,7 +38,7 @@ if (ob_get_level() == 0) ob_start(); | ||
38 | sleep(1); | 38 | sleep(1); |
39 | $arqcsv = $_FILES['i3GEOuploadcsv']['tmp_name']; | 39 | $arqcsv = $_FILES['i3GEOuploadcsv']['tmp_name']; |
40 | $nomePrefixo = str_replace(" ","_",removeAcentos($_FILES['i3GEOuploadcsv']['name'])); | 40 | $nomePrefixo = str_replace(" ","_",removeAcentos($_FILES['i3GEOuploadcsv']['name'])); |
41 | - $nomePrefixo = $nomePrefixo."_".(nomeRandomico(4)); | 41 | + $nomePrefixo = $nomePrefixo."_".(nomeRandomico(4)).".csv"; |
42 | 42 | ||
43 | $Arquivo = $_FILES['i3GEOuploadcsv']['tmp_name']; | 43 | $Arquivo = $_FILES['i3GEOuploadcsv']['tmp_name']; |
44 | $status = move_uploaded_file($Arquivo,$dir_tmp."/".$nomePrefixo); | 44 | $status = move_uploaded_file($Arquivo,$dir_tmp."/".$nomePrefixo); |
admin/php/metaestat_uploaddados_submit.php
@@ -7,7 +7,7 @@ if (isset($_FILES['i3GEOuploadArquivo']['name'])) | @@ -7,7 +7,7 @@ if (isset($_FILES['i3GEOuploadArquivo']['name'])) | ||
7 | { | 7 | { |
8 | require_once (dirname(__FILE__)."/../../ms_configura.php"); | 8 | require_once (dirname(__FILE__)."/../../ms_configura.php"); |
9 | $Arquivoup = $_FILES['i3GEOuploadArquivo']['tmp_name']; | 9 | $Arquivoup = $_FILES['i3GEOuploadArquivo']['tmp_name']; |
10 | - $nomearquivoserv = $dir_tmp."/upload".basename($Arquivoup); | 10 | + $nomearquivoserv = $dir_tmp."/upload".basename($Arquivoup).".csv"; |
11 | //echo $nomearquivoserv; | 11 | //echo $nomearquivoserv; |
12 | if(file_exists($nomearquivoserv)){ | 12 | if(file_exists($nomearquivoserv)){ |
13 | unlink($nomearquivoserv); | 13 | unlink($nomearquivoserv); |
admin/php/uploadgvp.php
@@ -22,9 +22,10 @@ if (isset($_FILES['i3GEOuploadgvp']['name'])){ | @@ -22,9 +22,10 @@ if (isset($_FILES['i3GEOuploadgvp']['name'])){ | ||
22 | ob_flush(); | 22 | ob_flush(); |
23 | flush(); | 23 | flush(); |
24 | sleep(1); | 24 | sleep(1); |
25 | - $arq = $locaplic."/temas/".$_FILES['i3GEOuploadgvp']['name']; | ||
26 | - //verifica nomes | ||
27 | verificaNome($_FILES['i3GEOuploadgvp']['name']); | 25 | verificaNome($_FILES['i3GEOuploadgvp']['name']); |
26 | + $ArquivoDest = $_FILES['i3GEOuploadgvp']['name']; | ||
27 | + $ArquivoDest = str_replace(".gvp","",$ArquivoDest).".gvp"; | ||
28 | + $arq = $locaplic."/temas/".$ArquivoDest; | ||
28 | if(file_exists($arq)){ | 29 | if(file_exists($arq)){ |
29 | unlink($arq); | 30 | unlink($arq); |
30 | } | 31 | } |