<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% '*** File Upload to: ../uploadarea, Extensions: "", Form: form1, Redirect: "/contactinformation/upload-info.asp" '*** Pure ASP File Upload ----------------------------------------------------- ' Copyright 2000 (c) George Petrov ' ' Script partially based on code from Philippe Collignon ' (http://www.asptoday.com/articles/20000316.htm) ' ' New features from GP: ' * Fast file save with ADO 2.5 stream object ' * new wrapper functions, extra error checking ' * UltraDev Server Behavior extension ' ' Version: 1.5.0 '------------------------------------------------------------------------------ Sub BuildUploadRequest(RequestBin) 'Get the boundary PosBeg = 1 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13))) if PosEnd = 0 then Response.Write "Form was submitted with no ENCTYPE=""multipart/form-data""
" Response.Write "Please correct the form attributes and try again." Response.End end if boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg) boundaryPos = InstrB(1,RequestBin,boundary) 'Get all data inside the boundaries Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--"))) 'Members variable of objects are put in a dictionary object Dim UploadControl Set UploadControl = CreateObject("Scripting.Dictionary") 'Get an object name Pos = InstrB(BoundaryPos,RequestBin,getByteString("Content-Disposition")) Pos = InstrB(Pos,RequestBin,getByteString("name=")) PosBeg = Pos+6 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34))) Name = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) PosFile = InstrB(BoundaryPos,RequestBin,getByteString("filename=")) PosBound = InstrB(PosEnd,RequestBin,boundary) 'Test if object is of file type If PosFile<>0 AND (PosFile "") Then if UploadQueryString <> "" then GP_uploadAction = GP_uploadAction & "&" & UploadQueryString end if End If If (CStr(Request.QueryString("GP_upload")) <> "") Then GP_redirectPage = "/contactinformation/upload-info.asp" If (GP_redirectPage = "") Then GP_redirectPage = CStr(Request.ServerVariables("URL")) end if RequestBin = Request.BinaryRead(Request.TotalBytes) Dim UploadRequest Set UploadRequest = CreateObject("Scripting.Dictionary") BuildUploadRequest RequestBin GP_keys = UploadRequest.Keys for GP_i = 0 to UploadRequest.Count - 1 GP_curKey = GP_keys(GP_i) 'Save all uploaded files if UploadRequest.Item(GP_curKey).Item("FileName") <> "" then GP_value = UploadRequest.Item(GP_curKey).Item("Value") GP_valueBeg = UploadRequest.Item(GP_curKey).Item("ValueBeg") GP_valueLen = UploadRequest.Item(GP_curKey).Item("ValueLen") if GP_valueLen = 0 then Response.Write "An error has occured saving uploaded file!

" Response.Write "Filename: " & Trim(GP_curPath) & UploadRequest.Item(GP_curKey).Item("FileName") & "
" Response.Write "File does not exists or is empty.
" Response.Write "Please correct and try again" response.End end if 'Create a Stream instance Dim GP_strm1, GP_strm2 Set GP_strm1 = Server.CreateObject("ADODB.Stream") Set GP_strm2 = Server.CreateObject("ADODB.Stream") 'Open the stream GP_strm1.Open GP_strm1.Type = 1 'Binary GP_strm2.Open GP_strm2.Type = 1 'Binary GP_strm1.Write RequestBin GP_strm1.Position = GP_ValueBeg GP_strm1.CopyTo GP_strm2,GP_ValueLen 'Create and Write to a File GP_curPath = Request.ServerVariables("PATH_INFO") GP_curPath = Trim(Mid(GP_curPath,1,InStrRev(GP_curPath,"/")) & "../uploadarea") if Mid(GP_curPath,Len(GP_curPath),1) <> "/" then GP_curPath = GP_curPath & "/" end if on error resume next GP_strm2.SaveToFile Trim(Server.mappath(GP_curPath))& "\" & UploadRequest.Item(GP_curKey).Item("FileName"),2 if err then Response.Write "An error has occured saving uploaded file!

" Response.Write "Filename: " & Trim(GP_curPath) & UploadRequest.Item(GP_curKey).Item("FileName") & "
" Response.Write "Maybe the destination directory does not exist, or you don't have write permission.
" Response.Write "Please correct and try again" err.clear response.End end if end if next '***GP BEGIN REDIRECT: with URL parameters (only if no Insert/Update) If (GP_redirectPage <> "") Then If (InStr(1, GP_redirectPage, "?", vbTextCompare) = 0 And UploadQueryString <> "") Then GP_redirectPage = GP_redirectPage & "?" & UploadQueryString End If strEmailBody = "" Set objNewMail = Server.CreateObject("CDONTS.NewMail") objNewMail.From = "sie@eightlegged.com" 'Trim(Request.Form("text1")) objNewMail.To = "sie@eightlegged.com" objNewMail.Subject = "Badge Shop Enquiry" objNewMail.BodyFormat = 0 objNewMail.MailFormat = 0 objNewMail.Body = "
Email Address
" + request("text1") + "
Name
" + request("text2") + "
Company Name
" + request("text3") + "
Address
" + request("textarea4") + "
Postcode
" + request("text5") + "
Telephone Number
" + request("text6") + "
I would like samples of ID Cards
" + request("checkbox7") + "
I would like samples of Name Badges
" + request("checkbox8") + "
Any Other Comments
" + request("textarea10") + "
Approx number of badges/cards needed
" + request("text11") + "
If you have an urgent deadline, please enter the date by which you must receive delivery
" + request("text12") + "
File Uploaded ( click to download )
" + session("filename") + "
" objNewMail.Send Set objNewMail = Nothing 'Response.redirect("thanks.asp") end if '***GP END REDIRECT end if if UploadQueryString <> "" then UploadQueryString = UploadQueryString & "&GP_upload=true" else UploadQueryString = "GP_upload=true" end if %> Tiffany Badges - Badge Order Form


badge order form 
  Tiffany Badges 




 Company



welcome


why use us?


special offer


more examples


photo ID - online!


 Badge Options



backgrounds


typeface options


layouts


fastenings


membership cards


 The Badge Shop



sample request


prices


 Communications



link to us


links to others


help page


contact us


why 'tiffany'?






THIS ORDER FORM IS CURRENTLY BEING REPAIRED

PLEASE EMAIL YOUR ORDERS TO:

linda@tiffanybadges.co.uk

UNTIL FURTHER NOTICE

To bookmark this page click here

If your badges have 1 or 2 lines of variable text enter the number of badges you wish to order in this box:
(but if you need lots of badges, see below)
 

If your badges have 3 or 4 lines of variable text OR....
If you are ordering lots of badges you should copy and paste your data "here"


<% if (IsNumeric(Request.Form("badges")) and Request.Form("nsubmit")="Submit") then Response.Redirect "contactinformation/nbadges.asp?num="&Request.Form("badges") end if %>







Tiffany Badges
Quality, Value and Speed
07002 BADGES
(223437)