| Current File : C:/Inetpub/vhosts/derecha3kmotor.com/httpdocs/2023/control/subirfotos.asp |
<html>
<head>
<title>Pagina nueva 1</title>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="expires" conten="01-mar-94 00:00:01 GMT">
</head>
<body>
<%
Response.CharSet = "UTF-8"
if Session("autadmin")=true or Session("autprensa")=true then
else
Response.Redirect("index.asp")
Response.End
end if
usuario=session("usuario")
' #####
conexion="PROVIDER=SQLOLEDB;DATA SOURCE=147.135.183.197;UID=admind3km;PWD=KyoshoChurri6791;DATABASE=derecha3kmotor"
tabla="usuarios"
raiz="c:\inetpub\vhosts\derecha3kmotor.com\httpdocs\2023\fotografias\"
' #####
entrada=request.querystring("entrada")
directorio=raiz
proceso="OK"
On Error Resume Next
Dim Upload
Set Upload = Server.CreateObject("Persits.Upload")
Upload.ProgressID = Request.QueryString("PID")
Upload.SetMaxSize 5000000, True
' Upload.OverwriteFiles = False
Upload.Save (directorio)
If Err.Number = 8 Then
Response.Write "El tama? del archivo es superior a 5 Mb. Por favor, reduzca el tama? del archivo e int?telo de nuevo."
Else
If Err <> 0 Then
Response.Write "Se ha producido un error: " & Err.Description & "<br>" & "Por favor, int?telo m? tarde."
proceso="no"
Else
End If
End If
Set File = Upload.Files(1)
Set File2 = Upload.Files(2)
' FICHERO PPAL A 980 pxls
' create instance of AspJpeg
Set jpg = Server.CreateObject("Persits.Jpeg")
' Open source file
jpg.Open(directorio&(file.extractfilename))
' Set resizing algorithm
jpg.Interpolation = 1
if jpg.width>jpg.height then
if jpg.width>980 then
' Set new height and width
nuevoalto=((jpg.height)*980)/jpg.width
jpg.Width = 980
jpg.Height = nuevoalto
' Sharpen resultant image
jpg.Sharpen 1, 101
' Perform resizing and
' send resultant image to client browser
' jpg.SendBinary
else
end if
else
end if
if jpg.height>jpg.width then
if jpg.height>980 then
' Set new height and width
nuevoancho=((jpg.width)*980)/jpg.height
jpg.Width = nuevoancho
jpg.Height = 980
' Sharpen resultant image
jpg.Sharpen 1, 101
' Perform resizing and
' send resultant image to client browser
' jpg.SendBinary
else
end if
else
end if
jpg.save (directorio & file.extractfilename)
' FICHERO INTERIOR A 675 pxls
' create instance of AspJpeg
Set jpg = Server.CreateObject("Persits.Jpeg")
' Open source file
jpg.Open(directorio&(file2.extractfilename))
' Set resizing algorithm
jpg.Interpolation = 1
if jpg.width>jpg.height then
if jpg.width>675 then
' Set new height and width
nuevoalto=((jpg.height)*675)/jpg.width
jpg.Width = 675
jpg.Height = nuevoalto
' Sharpen resultant image
jpg.Sharpen 1, 101
' Perform resizing and
' send resultant image to client browser
' jpg.SendBinary
else
end if
else
end if
if jpg.height>jpg.width then
if jpg.height>675 then
' Set new height and width
nuevoancho=((jpg.width)*675)/jpg.height
jpg.Width = nuevoancho
jpg.Height = 675
' Sharpen resultant image
jpg.Sharpen 1, 101
' Perform resizing and
' send resultant image to client browser
' jpg.SendBinary
else
end if
else
end if
jpg.save (directorio & file2.extractfilename)
fotoppal = file.extractfilename
fotointerior = file2.extractfilename
%>
<div align="center">
<center>
<table border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#003399">
<tr>
<td width="100%" align="center">
<font face="Trebuchet MS" size="2" color="#003399">Fotografía Principal: <%=file.extractfilename%></font></td>
</tr>
<tr>
<td width="100%" align="center"><img border="0" src="<%=raiz%><%=file.extractfilename%>"></td>
</tr>
</table>
<%
if fotointerior<>"" then
%>
<table border="0" width="100%" id="table1">
<tr>
<td> </td>
</tr>
</table>
<table border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#003399">
<tr>
<td width="100%" align="center">
<font face="Trebuchet MS" size="2" color="#003399">Fotografía Interior: <%=file2.extractfilename%></font></td>
</tr>
<tr>
<td width="100%" align="center"><img border="0" src="<%=raiz%><%=file2.extractfilename%>"></td>
</tr>
</table>
<%
else
end if
' ACTUALIZAMOS BD CON NOMBRES DE LOS FICHEROS DE FOTOGRAFIAS
conexion="PROVIDER=SQLOLEDB;DATA SOURCE=147.135.183.197;UID=admind3km;PWD=KyoshoChurri6791;DATABASE=derecha3kmotor"
tabla="entradas"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open(conexion)
sSQL="update entradas set foto1='" & fotoppal & "', foto2='" & fotointerior & "' where id='" & entrada & "'"
set RS = Conn.Execute(sSQL)
Conn.Close
%>
</center>
</div>
</body></html>