|
<%
function OutputForm()
%>
<%
end function
function TestEnvironment()
Dim fso, fileName, testFile, streamTest
TestEnvironment = ""
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if not fso.FolderExists(uploadsDirVar) then
TestEnvironment = "Folder " & uploadsDirVar & " does not exist. The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions."
exit function
end if
fileName = uploadsDirVar & "\test.txt"
on error resume next
Set testFile = fso.CreateTextFile(fileName, true)
If Err.Number<>0 then
TestEnvironment = "Folder " & uploadsDirVar & " does not have write permissions. The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions."
exit function
end if
Err.Clear
testFile.Close
fso.DeleteFile(fileName)
If Err.Number<>0 then
TestEnvironment = "Folder " & uploadsDirVar & " does not have delete permissions, although it does have write permissions. Change the permissions for IUSR_computername on this folder."
exit function
end if
Err.Clear
Set streamTest = Server.CreateObject("ADODB.Stream")
If Err.Number<>0 then
TestEnvironment = "The ADODB object Stream is not available in your server. Check the Requirements page for information about upgrading your ADODB libraries."
exit function
end if
Set streamTest = Nothing
end function
function SaveFiles
Dim Upload, fileName, fileSize, ks, i, fileKey,email_msg,c
dim file_names(3)
Set Upload = New FreeASPUpload
Upload.Save(uploadsDirVar)
' If something fails inside the script, but the exception is handled
If Err.Number<>0 then Exit function
SaveFiles = ""
c=1
ks = Upload.UploadedFiles.keys
if (UBound(ks) <> -1) then
SaveFiles = "Files uploaded: "
for each fileKey in Upload.UploadedFiles.keys
file_names(c) = Upload.UploadedFiles(fileKey).FileName
SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & "B) "
c = c+1
next
else
'SaveFiles = "The file name specified in the upload form does not correspond to a valid file in the system."
end if
'SaveFiles = SaveFiles & " Enter a number = " & Upload.Form("enter_a_number") & " "
'SaveFiles = SaveFiles & "Checkbox values = " & Upload.Form("checkbox_values") & " "
SaveFiles = "Name: "&Upload.Form("Name")&vbCrLf
if Upload.Form("Title") <> "" then
email_msg = email_msg&"Title: "&Upload.Form("Title")&vbCrLf
end if
email_msg = email_msg&"PHONE: "&Upload.Form("Phone")&vbCrLf
email_msg = email_msg&"EMAIL: "&Upload.Form("Email")&vbCrLf
if Upload.Form("Company_Name") <> "" then
email_msg = email_msg&"Company Name: "&Upload.Form("Company_Name")&vbCrLf
end if
if Upload.Form("Current_Revenue") <> "" then
email_msg = email_msg&"Current Revenue: "&Upload.Form("Current_Revenue")&vbCrLf
end if
if Upload.Form("Funding_Sought") <> "" then
email_msg = email_msg&"Funding Sought: "&Upload.Form("Funding_Sought")&vbCrLf
end if
if Upload.Form("Web_Site") <> "" then
email_msg = email_msg&"Web Site: "&Upload.Form("Web_Site")&vbCrLf
end if
if Upload.Form("message") <> "" then
email_msg = email_msg&"Comments: "&Upload.Form("message")&vbCrLf
end if
response.buffer = true
Dim strTo, strSubject, strBody 'Strings for recipient, subject, boby
strTo = "businessplan3@scppartners.com"
'response.write "SEND THE DAMN EMAIL
"
strBody = email_msg
strSubject = "SUBMIT A BUISNESS PLAN"
Dim MyMail
Set MyMail = CreateObject("CDO.Message")
MyMail.From = Upload.Form("Email")
MyMail.To = strTo
MyMail.Subject = strSubject
MyMail.TextBody =email_msg
if file_names(1) <> "" then
myMail.AddAttachment uploadsDirVar&file_names(1)
end if
if file_names(2) <> "" then
myMail.AddAttachment uploadsDirVar&file_names(2)
end if
if file_names(3) <> "" then
myMail.AddAttachment uploadsDirVar&file_names(3)
end if
MyMail.Send
Set MyMail= nothing
dim fs
Set fs=Server.CreateObject("Scripting.FileSystemObject")
if fs.FileExists(uploadsDirVar&file_names(1)) then
fs.DeleteFile(uploadsDirVar&file_names(1))
end if
if fs.FileExists(uploadsDirVar&file_names(2)) then
fs.DeleteFile(uploadsDirVar&file_names(2))
end if
if fs.FileExists(uploadsDirVar&file_names(3)) then
fs.DeleteFile(uploadsDirVar&file_names(3))
end if
set fs=nothing
response.redirect "thank_you.html"
end function
%>
<%
Dim diagnostics
if Request.ServerVariables("REQUEST_METHOD") <> "POST" then
diagnostics = TestEnvironment()
if diagnostics<>"" then
response.write(diagnostics)
else
OutputForm()
end if
else
SaveFiles()
'response.redirect "thank_you.html"
end if
%>
Home | Our Philosophy | Our Investment Strategy and Focus Areas | The SCP Team
Our Portfolio | SCP News | Contact Us | LP Login | Submit a Business Plan
© 2006 SCP Partners. All Rights Reserved.
|
|