Jeg har "valgt" et upload script der ser sådan ud..
<%
' Create an instance of AspUpload object
Set Upload = Server.CreateObject("Persits.Upload")
' Capture uploaded file. Save returns the number of files
uploaded
Count = Upload.Save("C:\Inetpub\wwwroot\~own\proff\upload")
If Count = 0 Then
Response.Write "Intet billede var markeret. <br><br><A
HREF=""pics.asp"">Prøv igen!</A>."
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
jpeg.Open( File.Path )
' resize image accoring to "scale" option.
' notice that we cannot use Request.Form, so we use Upload.Form
instead.
jpeg.Width = jpeg.OriginalWidth * Upload.Form("scale") / 100
jpeg.Height = jpeg.OriginalHeight * Upload.Form("scale") / 100
SavePath = "C:\Inetpub\wwwroot\~own\proff\upload\small\small_" &
File.ExtractFileName
' AspJpeg always generates JPEG thumbnails regardless of original
format.
' If the original file was not a JPEG, append .JPG extension.
If UCase(Right(SavePath, 3)) <> "JPG" Then
SavePath = SavePath & ".jpg"
End If
jpeg.Save SavePath
' Using ADO, save both images in the database along with
description.
strConnect = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" &
Server.MapPath("forum.mdb")
Set rs = Server.CreateObject("adodb.recordset")
rs.Open "images", strConnect, 1, 3
rs.AddNew
' Use File.Binary to access binary data of uploaded file.
rs("original_image").Value = File.Binary
Set ThumbFile = Upload.OpenFile(SavePath)
rs("thumbnail").Value = ThumbFile.Binary
rs("description") = Upload.Form("Description")
rs.Update
rs.Close
Set rs = Nothing
Response.Write "Succes! Dit billede er blevet uploadet.<br><br><a
href=""pics.asp"">Se dem her<p>"
Else
Response.Write "Det var et billede der skulle uploades!
<br><br><A HREF=""pics.asp"">Prøv igen!</A>."
Response.End
End If
End If
%>
Men jeg vil gerne ha' placet en tekst derpå. Har fundet scriptet,
men jeg ved ikke hvordan det skal sættes ind, det ser såden ud:
<%
Set Jpeg = Server.CreateObject("Persits.Jpeg")
' Open source image
Jpeg.Open Server.MapPath("images/dodge_viper.jpg")
' Resizing is optional. None in this code sample.
' Draw text
Jpeg.Canvas.Font.Color = &HFF0000 ' red
Jpeg.Canvas.Font.Family = "Courier New"
Jpeg.Canvas.Font.Bold = True
Jpeg.Canvas.Print 10, 10, "Copyright (c) XYZ, Inc."
' Draw frame: black, 2-pixel width
Jpeg.Canvas.Pen.Color = &H000000 ' Black
Jpeg.Canvas.Pen.Width = 2
Jpeg.Canvas.Brush.Solid = False ' or a solid bar would be drawn
Jpeg.Canvas.Bar 1, 1, Jpeg.Width, Jpeg.Height
Jpeg.Save Server.MapPath("images/dodge_viper_framed.jpg")
%>
Nogen der kan hjælpe mig med at sætte dette sammen ?
Hilsen Mads...
P.S. Disse scripts har jeg hentet på
www.aspupload.com
--
Vil du lære at kode HTML, XHTML, CSS, SSI eller ASP?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials