[Resolvido] Conexão MySql
Olá galera!
Tenhu um site de divulgação e cobertura de eventos. Nesse site tenhu vários albuns de fotos que são colocados via AspUpload. Eu uso o aspupload upando 10 fotos por vez. Digamos que com minha conexão leve 10 minutos para fazer o upload pro servidor 15 Mb de fotos (10 arquivos), quando tento acessar o site simultaneamente o site fica em branco, carregado até que as fotos sejam inseridas no site. Ou seja, parece que enquanto a conexão está aberta o site fica inoperante. Alguem sabe como evitar isso?
Arquivo da página de Upload:
<%
if Session("usuariologado") <> "logado" then
response.redirect "../../../central/?erro=2"
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url="[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]">](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)
<html xmlns="[url="[http://www.w3.org/1999/xhtml"]http://www.w3.org/1999/xhtml[/url]">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>ADM - ArquivoTeen.com.br</title>
<link rel="stylesheet" type="text/css" href="../../css/niftyCorners.css">
<link rel="stylesheet" type="text/css" href="../../css/niftyPrint.css" media="print">
<link rel="stylesheet" type="text/css" href="../../css/style.css">
<script type="text/javascript" src="../../css/nifty.js"></script><!-- #include file= "../../inc/conn.asp" -->
<!--#include file="../../inc/tratamento.asp"-->
<!--#include file="../../inc/destratamento.asp"-->
<!--#include file="../../inc/data_invertida.asp"-->
<!--#include file="../../inc/data.asp"-->
<%
server.scripttimeout = 600
Function RemoveAcentos(ByVal Texto)
Dim ComAcentos
Dim SemAcentos
Dim Resultado
Dim Cont
'Conjunto de Caracteres com acentos
ComAcentos = "ÁÍÓÚÉÄÏÖÜËÀÌÒÙÈÃÕÂÎÔÛÊáíóúéäïöüëàìòùèãõâîôûêÇç"
'Conjunto de Caracteres sem acentos
SemAcentos = "AIOUEAIOUEAIOUEAOAIOUEaioueaioueaioueaoaioueCc"
Cont = 0
Resultado = Texto
Do While Cont < Len(ComAcentos)
Cont = Cont + 1
Resultado = Replace(Resultado, Mid(ComAcentos, Cont, 1), Mid(SemAcentos, Cont, 1))
Loop
RemoveAcentos = Resultado
End Function
Function tratamento1(str)
Dim v
v = trim(str)
v = Replace(v,"/","-")
tratamento1 = v
End Function
'Session.LCID = 1046
if request.querystring("act") = "inc" then
Nome = tratamento(Request.Form("Nome"))
Fotografo = tratamento(Request.Form("Fotografo"))
Local = tratamento(Request.Form("Local"))
Data = datainvertida(Request.Form("Data"))
Data1 = datacerta(Data)
nome_local = lcase(Replace(RemoveAcentos(Local)," ",""))
nome_pasta = lcase(Replace(RemoveAcentos(Nome)," ",""))
Pasta = nome_pasta &"_"&nome_local&"_"&tratamento1(Data1)
'response.write Pasta
'response.end
Set arquivo = Server.CreateObject("Scripting.FileSystemObject")
fold = Pasta 'Recebe do form o nome da pasta...
if arquivo.FolderExists(pasta_albuns&fold) then 'Checa se a pasta já existe...
response.redirect "./?erro=pasta"
'dir = Server.MapPath(fold)
else
arquivo.CreateFolder(pasta_albuns&fold) 'Cria a pasta caso ela não exista..
dir = Server.MapPath(fold)
Set rstAlbum = Server.CreateObject("ADODB.RecordSet")
Sql = "INSERT INTO tbl_albuns (Nome,Data,Fotografo,Pasta,Local1) VALUES ('"&Nome&"','"&Data&"','"&Fotografo&"','"&Pasta&"','"&Local&"')"
'response.write Sql
'response.end
rstAlbum.Open Sql, conn
Set rstID = conn.execute("Select * FROM tbl_albuns WHERE id ORDER BY id DESC")
id = rstID("id")
pasta = rstID("Pasta")
album = rstID("Nome")
data = datainvertida(rstID("Data"))
fotografo = destratamento(rstID("Fotografo"))
conn.close
Set conn = nothing
End If
else
id = request.querystring("id")
pasta = request.querystring("pasta")
album = request.querystring("album")
data = datainvertida(request.querystring("data"))
fotografo = destratamento(request.querystring("fotografo"))
end if
%>
<%
Set UploadProgress = Server.CreateObject("Persits.UploadProgress")
PID = "PID=" & UploadProgress.CreateProgressID()
barref = "framebar.asp?to=10&" & PID
%>
<script LANGUAGE="JavaScript">
function ShowProgress()
{
strAppVersion = navigator.appVersion;
if (document.MyForm.FILE1.value != "" || document.MyForm.FILE2.value != "" || document.MyForm.FILE3.value != "" || document.MyForm.FILE4.value != "" || document.MyForm.FILE5.value != "" || document.MyForm.FILE6.value != "" || document.MyForm.FILE7.value != "" || document.MyForm.FILE8.value != "" || document.MyForm.FILE9.value != "" || document.MyForm.FILE10.value != "" || document.MyForm.FILE11.value != "" || document.MyForm.FILE12.value != "" || document.MyForm.FILE13.value != "" || document.MyForm.FILE14.value != "" || document.MyForm.FILE15.value != "" || document.MyForm.FILE16.value != "" || document.MyForm.FILE17.value != "" || document.MyForm.FILE18.value != "" || document.MyForm.FILE19.value != "" || document.MyForm.FILE20.value != "" || document.MyForm.FILE21.value != "" || document.MyForm.FILE22.value != "" || document.MyForm.FILE23.value != "" || document.MyForm.FILE24.value != "" || document.MyForm.FILE25.value != "" || document.MyForm.FILE26.value != "" || document.MyForm.FILE27.value != "" || document.MyForm.FILE28.value != "" || document.MyForm.FILE29.value != "" || document.MyForm.FILE30.value != "")
{
if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4)
{
if( strAppVersion.indexOf("Macintosh") != -1 && strAppVersion.charAt(0) >= 3 )
{
window.open('<% = barref %>&b=NN','','width=370,height=115', true);
}
else
{
winstyle = "dialogWidth=385px; dialogHeight:140px; center:yes";
window.showModelessDialog('<% = barref %>&b=IE',null,winstyle);
}
}
else
{
window.open('<% = barref %>&b=NN','','width=370,height=115', true);
}
}
return true;
}
</SCRIPT>
</head>
<body>
<table width="777" border="0" cellspacing="0" cellpadding="0" class="tabela_principal">
<tr>
<td height="150" colspan="3" class="topo"> </td>
</tr>
<tr>
<td height="10" colspan="3"></td>
</tr>
<tr>
<td width="10"> </td>
<td align="center" valign="top"><table width="757" border="0" cellpadding="0" cellspacing="0" class="tabela_centro">
<tr>
<td width="160" align="center" valign="top"><div class="tab" id="nifty">
<h3>Administração</h3>
<p>
<!--#include file="../../inc/menu_adm.asp"-->
</p>
</div>
<div class="tab" id="creditos">
<h3>by</h3><p>
<table width="100%" border="0" cellpadding="3" cellspacing="0" class="correcao_tabela">
<tr>
<td align="left" class="texto_negrito">Leandro Rocha (19) 9116-7802 </td>
</tr>
<tr>
<td align="left"><a href="Discussão (3)
Carregando comentários...