HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/PvdBoogaard/indoorski.nl/backup/oude-site/beheer/asp/upload/wijzigen-foto.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include virtual="/Connections/INDOORSKI_WRITER.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="/css/beheer.css" rel="stylesheet" type="text/css" />
</head>
<body>
<%
' Create an instance of AspUpload object
Set Upload = Server.CreateObject("Persits.Upload")

' Capture uploaded file, save to memory.
Count = Upload.Save

If Count = 0 Then
Response.Write "<center><span class=""BEH-Style02""><hr>Er is geen foto geslecteerd probeer het <A HREF=""/asp/fotoalbum/toevoegen-foto.asp"">opnieuw</a><br><hr></span></center>"
Response.End
Else

' Obtain File object representing uploaded file
Set File = Upload.Files(1)

' Is this a valid image file?
If File.ImageType <> "UNKNOWN" Then

' create instance of AspJpeg object
Set jpeg = Server.CreateObject("Persits.Jpeg")
			
' open uploaded file from memory
jpeg.OpenBinary( File.Binary )


' Using ADO, save both image and thumbnail in the database along with description.
strConnect = MM_INDOORSKI_WRITER_STRING
Set rs = Server.CreateObject("adodb.recordset")
rs.Open "SELECT * FROM TABEL_LERAREN WHERE id=" & Upload.Form("ID"), strConnect, 1, 3
'rs.AddNew

' New width
L = 70

' Resize, preserve aspect ratio
Jpeg.Width = L
Jpeg.Height = Jpeg.OriginalHeight * L / Jpeg.OriginalWidth

' Now Jpeg contains a resized version of the original file. Save it too.
rs("image").Value = Jpeg.Binary
rs.Update
rs.Close
			Set rs = Nothing

			Response.Write "<center><span class=""BEH-Style02""><hr>Gelukt de geselecteerde foto is opgeslagen in de database<br><hr></span></center>"
		Else			
			Response.Write "<center><span class=""BEH-Style02""><hr>De foto die is geslecteerd is geen geldig bestandsformaat probeer het <A HREF=""/asp/fotoalbum/toevoegen-foto.asp"">opnieuw</a><br><hr></span></center>"
			Response.End
		End If
	End If
%>
</BODY>
</HTML>