|
| |
|
|
sgreen0
Posts: 726 From: Long Beach, CA, USA Status: offline
|
Passing parameter question - 1/31/2006 4:00:29
I'm certain I got help with a similar problem before, but I can't find the thread. I need to pass parameters in an upload form. I have been trying to do it this way: <form name="MyForm" onsubmit="ShowProgressBar()" action="evaluator_file_uploader.asp?AccessLevel=<%=vAccessLevel%>&ID=<%=vID%>" enctype="multipart/form-data" method="post">
Oddly, vID (a number) gets passed properly but vAccessLevel (text) doesn't. I tried this: <input type="hidden" name="AccessLevel" value=<%=vAccessLevel%>> This doesn't get passed, either. In fact in that format, even the ID doesn't get passed! Since AccessLevel is text, I've tried adding quotes in various places with no success. Can someone help me (again!) with the correct syntax? Thanks so much. Stephen
|
|
|
|
rdouglass
Posts: 9229 From: Biddeford, ME USA Status: offline
|
RE: Passing parameter question - 1/31/2006 8:11:12
quote:
...tor_file_uploader.asp?AccessLevel=<%=vAccessLevel%>&... Does anything show up in that querystring at all? IOW is your problem that <%=vAccessLevel%> doesn't work or Request("AccessLevel") doesn't work?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
sgreen0
Posts: 726 From: Long Beach, CA, USA Status: offline
|
RE: Passing parameter question - 1/31/2006 11:05:21
I don't know how to check that... I've tested the presence of vAccessLevel until the line before the form that sends it to the next page. So it does exist. I find it really odd the vID gets passed and vAccessLevel doesn't. I thought it had to do with the text / numeric thing... Stephen
|
|
|
|
sgreen0
Posts: 726 From: Long Beach, CA, USA Status: offline
|
RE: Passing parameter question - 1/31/2006 12:03:39
Well, here's something interesting! This is the line from View Source in FireFox: <form name="MyForm" onsubmit="ShowProgressBar()" action="evaluator_file_uploader.asp?AccessLevel=lyric&EvalID=3&ID=" enctype="multipart/form-data" method="post">
Notice that ID is blank, while the other varables are full. On the next page, where at the very top I place the requests and response.writes like this: <%@language=vbscript%>
<% Dim vID, vAccessLevel, vEvalID
vID=Request.QueryString("ID")
vAccessLevel=Request("AccessLevel")
vEvalID=Request.QueryString("EvalID")
response.write vAccessLevel
response.write vID
response.write vEvalID
response.end
%>
ONLY THE ID COMES THROUGH! Something really wierd is going on... Stephen
|
|
|
|
sgreen0
Posts: 726 From: Long Beach, CA, USA Status: offline
|
RE: Passing parameter question - 1/31/2006 13:12:44
I made some changes. The first page now says: <form name="MyForm" onsubmit="ShowProgressBar()" action="evaluator_file_uploader.asp?StudentID=<%=vStudentID%>&StudentAccessLevel=<%=vStudentAccessLevel%>" enctype="multipart/form-data" method="post">
And the View source looks like this: <form name="MyForm" onsubmit="ShowProgressBar()" action="evaluator_file_uploader.asp?StudentID=139&StudentAccessLevel=lyric" enctype="multipart/form-data" method="post"> Notice that StudentID and StudentAccessLevel are correctly present. On the receiving page: <%@language=vbscript%>
<% Dim vStudentID, vStudentAccessLevel
vStudentID=Request.QueryString("StudentID")
vStudentAccessLevel=Request.Querystring("StudentAccessLevel")
response.write "StudentAccessLevel =" & vStudentAccessLevel
response.write "StudentID = " & vStudentID
response.end
%> And the result: StudentAccessLevel = StudentID = I also tried this within the form: <input type="hidden" name="StudentID" value="<%=vStudentID%>">
<input type="hidden" name="StudentAccessLevel" value="<%=vStudentAccessLevel%>"> And this on the receiving page: <% Dim vStudentID, vStudentAccessLevel
vStudentID=Request.Form("StudentID")
vStudentAccessLevel=Request.Form("StudentAccessLevel")
response.write "StudentAccessLevel = " & vStudentAccessLevel
response.write "StudentID = " & vStudentID
response.end
%>
Same result: StudentAccessLevel = StudentID = HELP! Stephen
|
|
|
|
rdouglass
Posts: 9229 From: Biddeford, ME USA Status: offline
|
RE: Passing parameter question - 1/31/2006 13:20:33
Some quick things: Have you DIM'ed all your ASP variables? Have you response.write them on every page they're supposed to be on to conform they are what they are supposed to be? Are you trying to pass ASP variables between pages? (That can't be done directly but must be passed using HTML-type items which it clearly looks as tho you are doing properly - just confirming).
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
sgreen0
Posts: 726 From: Long Beach, CA, USA Status: offline
|
RE: Passing parameter question - 1/31/2006 14:44:53
Yes, for safety's sake, I always DIM my variables. I've "response.written" the variables throught the original page, including witin the form on that page. The values of the variables are lost between pages. Even the hidden form fields get lost. I've been struggling with this and I'm completely stumped. No doubt the answer is really simple and I'm just missing it... Stephen PS I'd attach files, but they're pretty long...
|
|
|
|
BeTheBall
Posts: 6359 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Passing parameter question - 1/31/2006 15:09:46
What is the name of the receiving page?
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
sgreen0
Posts: 726 From: Long Beach, CA, USA Status: offline
|
RE: Passing parameter question - 1/31/2006 15:18:50
Sending page: evaluator_student_status_page.asp Receiving page: evaluator_file_uploader.asp The purpose of the receiving page is to upload the file selected on the sending page; then post some related data to a table. Here is that page: <%@language=vbscript%>
<% Dim vStudentID, vStudentAccessLevel
vStudentID=Request.Form("StudentID")
vStudentAccessLevel=Request.Form("StudentAccessLevel")
response.write "StudentAccessLevel = " & vStudentAccessLevel
response.write "StudentID = " & vStudentID
response.end
%>
<!-- #include file="Upload.asp" -->
<%
dim Uploader, File, Name, Items
'Get reference to ASPUploader:
set Uploader = GetASPUploader
'Set Upload Folder
Uploader.Destination = "../" & vStudentAccessLevel & "/Student_Uploads/" & vStudentID
'ID is needed for progress bar only:
Uploader.ID = ID
'To restrict file types (file extensions) that users can upload, uncomment and edit this list:
'Uploader.ValidFileTypes = "mp3,doc,rtf,pdf,htm,xml,jpg,bmp,gif,png,swf"
'Limit total upload size:
Uploader.MaxTotalBytes = 2000000000
'By default, if uploaded file already exists in Destination, a number is appended to the name of new file.
'In order to overwrite existing files having the same name as the uploaded files, uncomment this:
Uploader.Overwrite = true
'By default, ASPUploader automatically deletes incomplete files of unsuccessful (or canceled) uploads.
'If you do not want ASPUploader to delete such incomplete files, uncomment this:
'Uploader.DeleteIncomplete = false
'Set longer timeout for large files if needed:
Server.ScriptTimeout = 900
'You can upload files directly to their destination folder. But it is a good practice to use a
'temporary folder for files being uploaded and then move completed files to their final destination.
'This way ensures the final destination will never contain incomplete files even if you shutdown
'your web server during upload or if electric power outage occurs.
'Use either physical (C:\Temp), relative (..\Temp), or virtual (/Temp) paths:
Uploader.Destination = "/Temp"
'If user cancels upload or attempts to upload files of invalid (unallowed) type or size, ASPUploader will
'raise an exception (error) with relevant descrition. Enable error handling to catch and handle such errors:
on error resume next
'Start receiving and saving file(s):
Uploader.Upload
'Check for error:
if Err then
Response.Write Err.Source & ": " & Err.Description
Response.End
end if
'The upload is successful (not canceled and no errors), if Err.Number = 0.
'Move all uploaded files to their final destination:
for each File in Uploader.Files.Items
response.write "../" & vStudentAccessLevel & "/Student_Uploads/" & vuStudentID &"\"
response.end
File.Move "../" & vStudentAccessLevel & "/Student_Uploads/" & vStudentID &"\"
'Note: Path separator "\" means that "Upload\" is folder (not file) where to move the file (see manual).
next
'Instead of moving all files to single destination, you could move each file to its own (different)
'destination, if needed. For example, to move the first file to folder "C:\Special", uncomment this:
'if Uploader.Files.Exists("File1") then Uploader.Files("File1").Move "C:\Special\"
'Note: "File1" is the input name of field that we have used in the html form for the first file.
'You can move a file and at the same time change its name with a single call to Move method. For example, to
'move the second file to folder "C:\Special" and change its filename to "User_DateTime.zip", uncomment this:
'if Uploader.Files.Exists("File1") then Uploader.Files("File1").Move "../" & vStudentAccessLevel & "/Student_Uploads/" & vStudentID & "\" & Date() & File.Name
'Note: You can use Copy method the same way. Also, Delete and Rename methods are available (see manual).
'Read properties of each uploaded file:
'Response.Write "You uploaded " & Uploader.Files.Count & " file(s)" & "<hr>"
'for each File in Uploader.Files.Items
' Response.Write "Filename: " & File.Name & "<br>"
' Response.Write "Size: " & File.Size & " bytes<br>"
' Response.Write "Content type: " & File.ContentType & "<br>"
'Response.Write "Client path: " & File.ClientPath & "<br><hr>"
' next
'Read values of each field of html form:
' Response.Write "You submitted the following form fields:<br>"
' for each Name in Uploader.Form
' Response.Write Name & ": " & Uploader.Form(Name) & "<br>"
'next
'Response.Write "<hr>"
'Response.Write "Accessing individual files and form fields (see source code):<br>"
'Access uploaded files individually by either input name or index:
'if Uploader.Files.Exists("File1") then
' Response.Write "Name of File1 is " & Uploader.Files("File1").Name & "<br>" 'access by input name ("File1")
'Items = Uploader.Files.Items
'Response.Write "Size of the first file is " & Items(0).Size & " byte<br>" 'access by index (0 is index of the first file)
'end if
'Access values of form fields individually by either input name or index:
'Response.Write "Value of Text1 field is " & Uploader.Form("Text1") & "<br>" 'access by input name ("Text1")
'Items = Uploader.Form.Items
'Response.Write "Value of the second field is " & Items(1) 'access by index (1 is index of the second field)
'Check for errors:
if Err then
Response.Clear
Response.Write Err.Source & ": " & Err.Description
else ' Success
' Insert record into SoundInfo with ID, EvalID, and filename
'MyConnString = Application("online_ConnectionString")
'Set myConnection = Server.CreateObject("ADODB.Connection")
'myConnection.Open myConnString
'mySQL = "INSERT INTO SoundInfo "
'mySQL= mySQL & "(ID, EvalID, FileName) "
'mySQL= mySQL & "VALUES (" & vStudentID & ","
'mySQL = mySQL & Session("uEvalID") & ", "
'mySQL = mySQL & "'welcome.mp3')"
'response.write mySQL
'response.end
'myConnection.Execute mySQL
'myConnection.Close
'Set myConnection = Nothing
'If Err <> 0 Then ' error occurred
' strErr = Err.Description
' Response.Write "halted : " & strErr
'else
' bSuccess = True
'response.redirect("")
'End If
response.redirect "http://www.writingmusicaltheatre.com/Evaluator/Evaluator_Student_status_page.asp?ID="&Session("uStudentID")
End If
%>
The final reoutine that inserts data into the table is currently commented out... Stephen
|
|
|
|
BeTheBall
Posts: 6359 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Passing parameter question - 1/31/2006 16:49:06
Your parameters are in the querystring of the Action, not in form fields. Therefore, you must use Request.Querystring, not Request.Form. <% Dim vStudentID, vStudentAccessLevel vStudentID=Request.Querystring("StudentID") vStudentAccessLevel=Request.Querystring("StudentAccessLevel") response.write "StudentAccessLevel = " & vStudentAccessLevel response.write "StudentID = " & vStudentID response.end %>
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
sgreen0
Posts: 726 From: Long Beach, CA, USA Status: offline
|
RE: Passing parameter question - 1/31/2006 16:55:45
Duane! Thanks for your reply. The version of the page you looked at is from an attempt to pass the data using hidden fields in the form on the previous page - no luck. In other attempts, I have indeed used Request.Querystring("StudentAccessLevel"). Here is the real conundrum. Using <form name="MyForm" onsubmit="ShowProgressBar()" action="evaluator_file_uploader.asp?StudentID=<%=vStudentID%>&StudentAccessLevel=<%=vStudentAccessLevel%>" enctype="multipart/form-data" method="post">
and <% Dim vStudentID, vStudentAccessLevel
vStudentID=Request.Querystring("StudentID")
vStudentAccessLevel=Request.Querystring("StudentAccessLevel")
response.write "StudentAccessLevel = " & vStudentAccessLevel
response.write "StudentID = " & vStudentID
response.end
%>
The StudentID gets passed, but the StudentAccessLevel doesn't! Thanks for your help. Stephen
|
|
|
|
sgreen0
Posts: 726 From: Long Beach, CA, USA Status: offline
|
RE: Passing parameter question - 1/31/2006 17:01:34
I lied! Neither one is passed now... S.
|
|
|
|
BeTheBall
Posts: 6359 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Passing parameter question - 1/31/2006 19:00:48
Don't suppose you have a link to these pages?
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
sgreen0
Posts: 726 From: Long Beach, CA, USA Status: offline
|
RE: Passing parameter question - 2/1/2006 2:56:52
Duane! Go to www.writingmusicaltheatre.com. Login as evaluator / guest. From the page you arrive at, click "View Entry". On the next page, scroll down to the bottom and click "Upload". (Don't worry about Browsing for a file as we're not really uploading...) When you click on "Upload", you SHOULD see the following: StudentAccessLevel = lyricStudentID = 45 However, what you Do see is: StudentAccessLevel = StudentID = This page never gets the passed variables currently collected using request.querystring("StudentAccessLevel"). Thanks for looking. Stephen
|
|
|
|
BeTheBall
Posts: 6359 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Passing parameter question - 2/1/2006 10:02:18
So what's the code for Evaluator_Student_Status_Page.asp?
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
sgreen0
Posts: 726 From: Long Beach, CA, USA Status: offline
|
RE: Passing parameter question - 2/1/2006 11:20:22
Here it is. You will find the code for the upload form at the very botttom of the file. <!-- #include virtual="/spooky_protection_eval.inc" -->
<%
Dim vStudentID,vFirstName,vLastName,vStudentAccessLevel,vEvalID
vStudentID=Request.Querystring("StudentID")
vFirstName=Request.Querystring("Firstname")
vLastName=Request.Querystring("LastName")
vStudentAccessLevel=Request.Querystring("StudentAccessLevel")
vEvalID=Request.Querystring("EvalID")
'response.write vAccessLevel
'response.write vID
'response.write vEvalID
'response.end
%>
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Lyric Student Status Page</title>
</head>
<body bgcolor="#000000" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="750">
<tr>
<td width="750" colspan="2" background="http://www.writingmusicaltheatre.com/images/mainbanner.jpg" height="110">
<p></td>
</tr>
<tr>
<td width="150" bgcolor="#000000" valign="top" background="http://www.writingmusicaltheatre.com/images/mainsidebar.jpg">
</td>
<td width="607" bgcolor="#000000" valign="top" background="http://www.writingmusicaltheatre.com/images/mainbackground.jpg" style="margin-top: 0; margin-bottom: 0">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; margin-left:12" bordercolor="#111111" width="549">
<tr>
<td width="323" colspan="2">
<p align="left" style="margin-left: 25; margin-top: 20">
<i><b><font face="Arial" size="4" color="#FFFFFF">YOUR STUDENT'S STATUS</font></b></i></td>
<td width="226"><p align="right" style="margin-left: 4; margin-top:15"><i>
<font face="Arial" size="3"><b><%=vFirstName%> <%=vLastName%></b></font></i></p>
</td>
</tr>
</table>
<!-- Get Student's Info from Students ID -->
<!--#include file="../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT OnLineContacts.ID, OnLineContacts.LastName AS OnLineContacts_LastName, OnLineContacts.FirstName AS OnLineContacts_FirstName, OnLineContacts.Address, OnLineContacts.City, OnLineContacts.State, OnLineContacts.Zip, OnLineContacts.Country, OnLineContacts.HomePhone, OnLineContacts.CellPhone, OnLineContacts.Email AS OnLineContacts_Email, OnLineRegistration.CourseID, OnLineRegistration.EvalId, OnLineEvaluators.LastName AS OnLineEvaluators_LastName, OnLineEvaluators.FirstName AS OnLineEvaluators_FirstName, OnLineEvaluators.Email AS OnLineEvaluators_Email FROM OnLineEvaluators INNER JOIN (OnLineContacts INNER JOIN OnLineRegistration ON OnLineContacts.ID = OnLineRegistration.ID) ON OnLineEvaluators.EvalID = OnLineRegistration.EvalId WHERE OnlineContacts.ID = " & vStudentID & ""
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="online"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&OnLineContacts_LastName=202&OnLineContacts_FirstName=202&Address=202&City=202&State=202&Zip=202&HomePhone=202&CellPhone=202&OnLineContacts_Email=202&CourseID=3&EvalId=3&OnLineEvaluators_LastName=202&OnLineEvaluators_FirstName=202&OnLineEvaluators_Email=202&"
fp_iDisplayCols=15
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<!-- Display Student Info -->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; margin-left:12" bordercolor="#111111" width="551">
<tr>
<td colspan="2" width="551"><p align="right"><font face="Arial" size="1"><i><b><%=FP_FieldVal(fp_rs,"Address")%></b></i></tr></td>
<tr>
<td width="286" rowspan="6">
<p style="margin-left: 25">
</td>
<td width="265"><p align="right"><font face="Arial" size="1"><i><b><%=FP_FieldVal(fp_rs,"City")%>, <%=FP_FieldVal(fp_rs,"State")%> <%=FP_FieldVal(fp_rs,"Zip")%>
</b></i></td></tr>
<tr>
<td width="265"><p align="right"><font face="Arial" size="1"><i><b><%=FP_FieldVal(fp_rs,"Country")%>
</b></i></td></tr>
<tr>
<td width="265"><p align="right"><font face="Arial" size="1"><i><b><%=FP_FieldVal(fp_rs,"HomePhone")%>
</b></i></td></tr>
<tr>
<td width="265"><p align="right"><font face="Arial" size="1"><i><b><a href="mailto:<%=FP_FieldVal(fp_rs,"OnlineContacts_Email")%>"><%=FP_FieldVal(fp_rs,"OnlineContacts_Email")%></a>
</b></i></td></tr>
<tr><td width="265"><p align="right"><font face="Arial" size="1"> </td></tr>
<tr><td width="265"><p align="right"><font face="Arial" size="1"> </td></tr>
<!--#include file="../_fpclass/fpdbrgn2.inc"-->
</table>
<p style="margin-left: 25; margin-right: 55; margin-top: 5"></p>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="80%">
<tr>
<td width="100%">
<!-- Get and Display Student's Daily Dozen Entries - show link to view -->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="486" height="1">
<tr>
<td width="486" style="padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="1">
<p style="margin-top: 0; margin-bottom: 0">
<b>
<font face="Arial" size="2">
Lyric Lab Daily Dozen Entries</font></b></p>
</td>
</tr>
<td width="191" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="15"><i><b>
<font face="Arial" size="1"> Week Ending Date</font></b></i></td>
<td width="94" align="center" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="15"><i><b>
<font size="1" face="Arial"> # of Entries</font></b></i></td>
<td width="60" align="center" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="15"><i><b>
<font size="1" face="Arial"> Notes</font></b></i></td>
<td width="104" align="center" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="15"><i><b>
<font size="1" face="Arial"> View</font></b></i></td>
</tr>
<!--#include file="../_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT DailyDozen.ID, DailyDozen.WeekEnding, DailyDozen.LastEntry, DailyDozen.Simile, DailyDozen.Metaphor, DailyDozen.SongTitles, DailyDozen.Springboards, DailyDozen.Rhyme, DailyDozen.Images, DailyDozen.Lyric, DailyDozen.Notes FROM DailyDozen WHERE DailyDozen.ID = " & vStudentID & " ORDER BY DailyDozen.WeekEnding DESC"
fp_sDefault="DailyDozen.ID=0"
fp_sNoRecords=""
fp_sDataConn="online"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&WeekEnding=135&LastEntry=135&Simile=203&Metaphor=203&SongTitles=203&Springboards=203&Rhyme=203&Images=203&Lyric=203&Notes=203&"
fp_iDisplayCols=7
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<%
'response.write fp_sQry
'response.end
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<tr>
<td width="191" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1" align="left" height="17">
<font face="Arial" size="1">
<%=FP_Field(fp_rs,"WeekEnding")%> </font></td>
<% Dim vCount
vCount=0
If FP_Field(fp_rs,"Simile") <> "" Then
vCount=vCount+1
End If
If FP_Field(fp_rs,"Metaphor") <> "" Then
vCount=vCount+1
End If
If FP_Field(fp_rs,"SongTitles") <> "" Then
vCount=vCount+1
End If
If FP_Field(fp_rs,"SpringBoards") <> "" Then
vCount=vCount+1
End If
If FP_Field(fp_rs,"Rhyme") <> "" Then
vCount=vCount+1
End If
If FP_Field(fp_rs,"Images") <> "" Then
vCount=vCount+1
End If
If FP_Field(fp_rs,"Lyric") <> "" Then
vCount=vCount+1
End If %><font size="1"> </font>
<td width="94" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" align="center" height="17">
<font face="Arial" size="1"><%=vCount%> </font>
</td>
<td width="60" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" align="center" height="17">
<font face="Arial" size="1">
<% If FP_Field(fp_rs,"Notes") <> "" Then
response.write "Yes"
Else
response.write "No"
End If %></font><font size="1"> </font>
</td>
<td width="104" align="center" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="17">
<i>
<font size="1" face="Arial"><a href="http://www.writingmusicaltheatre.com/Evaluator/Evaluator_View_Entries.asp?WeekEnding=<%=Server.Urlencode(FP_FieldVal(fp_rs,"WeekEnding"))%>&ID=<%=Server.Urlencode(FP_FieldVal(fp_rs,"ID"))%>">
View Entry</a></font></i></td>
</td>
</tr>
<!--#include file="../_fpclass/fpdbrgn2.inc"-->
</table>
<p style="margin-top: 10; margin-bottom: 0">
</p>
<!-- Get and Display Student's Sound Files - show link to view -->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="342" height="1">
<tr>
<td width="408" style="padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="1">
<p style="margin-top: 0; margin-bottom: 0">
<b>
<font face="Arial" size="2">
Lyric Lab Evaluator Sound Files</font></b></p>
</td>
</tr>
<td width="113" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="15"><i><b>
<font face="Arial" size="1"> Sound Files (by date)</font></b></i></td>
<td width="38" align="center" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="15"><i><b>
<font size="1" face="Arial"> </font></b></i></td>
</tr>
<!--#include file="../_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT * FROM SoundInfo WHERE ID = " & vStudentID & " ORDER BY Filename DESC"
fp_sDefault="DailyDozen.ID=0"
fp_sNoRecords=""
fp_sDataConn="online"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&WeekEnding=135&LastEntry=135&Simile=203&Metaphor=203&SongTitles=203&Springboards=203&Rhyme=203&Images=203&Lyric=203&Notes=203&"
fp_iDisplayCols=7
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<%
'response.write fp_sQry
'response.end
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<tr>
<td width="113" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1" align="left" height="17">
<font face="Arial" size="1">
<%=FP_Field(fp_rs,"Filename")%> </font></td>
<font size="1"> </font>
<td width="38" align="center" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="17">
<i>
<font size="1" face="Arial"><a href="http://www.writingmusicaltheatre.com/lyric/Student_Uploads/<%=vStudentID%>/<%=FP_FieldVal(fp_rs,"Filename")%>">
Listen</a></font></i></td>
</td>
</tr>
<!--#include file="../_fpclass/fpdbrgn2.inc"-->
</table>
<p style="margin-top: 10; margin-bottom: 0">
</p>
<!-- Get Student's Test Info and Display link to Take Test -->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="546">
<tr>
<td width="546" style="padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="21">
<b>
<font face="Arial" size="2">
Lyric Lab Test Summary</font></b></td>
</tr>
<tr>
<td width="325" valign="top" bordercolor="#111111" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="15">
<i><b><font size="1" face="Arial"> Test Name</font></b></i><font face="Arial" size="1">
</font>
</td>
<td width="83" valign="top" style="padding:0; border-style:solid; border-width:1; " height="15" align="center">
<i><b><font size="1" face="Arial"> Date Taken</font></b></i><font face="Arial" size="1">
</font>
</td>
<td width="59" valign="top" style="padding:0; border-style:solid; border-width:1; " height="15" align="center">
<i><b><font size="1" face="Arial"> Retake</font></b></i><font face="Arial" size="1">
</font>
</td>
<td width="87" valign="top" style="padding:0; border-style:solid; border-width:1; " height="15" align="center">
<i><b><font size="1" face="Arial"> Grade</font></b></i><font face="Arial" size="1">
</font>
</td>
<td width="30" valign="top" style="padding:0; border-style:solid; border-width:1; " height="15" align="center">
<i><b><font size="1" face="Arial"> Pass</font></b></i><font face="Arial" size="1">
</font>
</td>
</tr>
<!--#include file="../_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT TestResultsSummary.ID, TestResultsSummary.TestID, TestResultsSummary.DateTaken, TestResultsSummary.Retake, TestResultsSummary.Pass, TestResultsSummary.Grade, TestInfo.CourseID, TestInfo.TestName, TestInfo.TableName, TestInfo.PointsPerQuestion, TestInfo.NumberofQuestions FROM TestInfo INNER JOIN TestResultsSummary ON TestInfo.TestID = TestResultsSummary.TestID WHERE TestResultsSummary.ID = " & vStudentID & " AND TestInfo.CourseID = 1 ORDER BY TestInfo.TestName"
fp_sDefault="TestInfo.CourseID=1"
fp_sDataConn="online"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&TestID=3&DateTaken=135&Retake=3&Grade=3&Pass=11&CourseID=3&TestName=202&TableName=202&PointsperQuestion=202&NumberofQuestions=202&"
fp_iDisplayCols=4
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<tr>
<td width="325" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1">
<font face="Arial" size="1">
<%=FP_FieldVal(fp_rs,"TestName")%></td>
<td width="83" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" align="center">
<font face="Arial" size="1">
<% If FP_FieldVal(fp_rs,"DateTaken") = "1/1/2000" Then
response.write " "
Else %> <font face="Arial">
<%=FP_FieldVal(fp_rs,"DateTaken")%>
<% End If %> </font>
</font><font face="Arial" size="1">
</td>
<td width="59" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" align="center">
<font face="Arial" size="1">
<%=FP_FieldVal(fp_rs,"Retake")%></td>
<% Dim vOutof
vOutof=(FP_FieldVal(fp_rs,"NumberOfQuestions")*FP_FieldVal(fp_rs,"PointsPerQuestion"))%><font face="Arial" size="1">
</font>
<td width="87" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" align="center">
<font face="Arial" size="1">
<%=Fp_FieldVal(fp_rs,"Grade")%></font><font face="Arial" size="1">/<%=vOutof%>
</td>
<td width="30" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" align="center">
<font face="Arial" size="1">
<% If FP_FieldVal(fp_rs,"Pass") = "False" Then
response.write "No"
Else
response.write "Yes"
End If
%> </font><font face="Arial" size="1">
</td>
<font face="Arial" size="1">
</td>
</font>
</tr>
<!--#include file="../_fpclass/fpdbrgn2.inc"-->
</table>
<p style="margin-top: 10; margin-bottom: 0">
</p>
<!-- Get and Display Student's Assignment Results - show link to view -->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="546">
<tr>
<td width="546" style="padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="21">
<b>
<font face="Arial" size="2">
Lyric Lab Assignment Summary</font></b></td>
</td>
</tr>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="546">
<tr>
<td width="270" style="padding-left: 4; padding-right: 4; padding-top: 0; padding-bottom: 0" height="17"><i><b>
<font face="Arial" size="1"> Assignment Name</font></b></i></td>
<td width="89" align="center" height="17"><i><b>
<font size="1" face="Arial"> Date Taken</font></b></i></td>
<td width="104" align="center" height="17"><i><b>
<font size="1" face="Arial"> Date Graded</font></b></i></td>
<td width="47" align="center" height="17"><i><b>
<font size="1" face="Arial"> Pass</font></b></i></td>
<td width="113" align="center" height="17"><i><b>
<font face="Arial" size="1">
Status</font></b></i></td>
</tr>
<!--#include file="../_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT AssignmentResultsSummary.ID, AssignmentResultsSummary.AssignmentID, AssignmentResultsSummary.DateTaken, AssignmentResultsSummary.DateGraded, AssignmentResultsSummary.Grade, AssignmentResultsSummary.Retake, AssignmentResultsSummary.Pass, AssignmentInfo.CourseID, AssignmentInfo.AssignmentName, AssignmentInfo.TableName FROM AssignmentInfo INNER JOIN AssignmentResultsSummary ON AssignmentInfo.AssignmentID = AssignmentResultsSummary.AssignmentID WHERE AssignmentResultsSummary.ID = " & vStudentID & " AND AssignmentInfo.CourseID = 1 ORDER BY AssignmentInfo.AssignmentName"
fp_sDefault="AssignmentInfo.CourseID=1"
fp_sNoRecords="<tr><td colspan=7 align=left width=""100%"">Please select course from drop down above.</td></tr>"
fp_sDataConn="online"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&CourseID=3&EvalId=3&LastName=202&FirstName=202&Email=202&AssignmentID=3&AssignmentName=202&TableName=202&DateTaken=135&DateGraded=135&Grade=3&Notes=203&Retake=3&Pass=11&"
fp_iDisplayCols=7
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<%
'response.write fp_sQry
'response.end
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<%
Dim vTableName,vAssignmentID
vTableName=FP_FieldVal(fp_rs,"TableName")
vAssignmentID=FP_FieldVal(fp_rs,"AssignmentID")
%>
<tr>
<td width="270" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="17">
<font face="Arial" size="1">
<%=FP_Field(fp_rs,"AssignmentName")%></td>
<td width="89" align="center" height="17">
<font face="Arial" size="1">
<% If FP_FieldVal(fp_rs,"DateTaken") = "1/1/2000" Then
response.write " "
Else %>
<%=FP_FieldVal(fp_rs,"DateTaken")%></font></td>
<% End If %><font face="Arial" size="1"> </font>
<td width="104" align="center" height="17">
<font face="Arial" size="1">
<% If FP_FieldVal(fp_rs,"DateGraded") = "1/1/2000" Then
response.write " "
Else %>
<%=FP_FieldVal(fp_rs,"DateGraded")%></font></td>
<% End If %><font face="Arial" size="1">
<td width="47" align="center" height="17"><font face="Arial" size="1">
<% If FP_FieldVal(fp_rs,"Pass") = "False" Then
response.write "No"
Else
response.write "Yes"
End If
%></td>
<% If FP_FieldVal(fp_rs,"DateGraded") <> "1/1/2000" Then %> </font>
<td width="113" align="center" height="17">
<font face="Arial"><i>
<font size="1"><a href="View_<%=FP_FieldVal(fp_rs,"TableName")%>.asp?AssignmentName=<%=Server.Urlencode(FP_FieldVal(fp_rs,"AssignmentName"))%>&AssignmentID=<%=Server.Urlencode(FP_FieldVal(fp_rs,"AssignmentID"))%>&TableName=<%=Server.Urlencode(FP_FieldVal(fp_rs,"TableName"))%>">
View Results</a></font></i></td>
<% End If %><font size="1">
<% If FP_FieldVal(fp_rs,"DateTaken") = "1/1/2000" Then %> </font></font>
<td width="84" align="center" height="17">
<font face="Arial"><i>
<font size="1" color="#FFFFFF">Not Taken</font><font color="#FFFFFF"></a></font></i><font size="1" color="#FFFFFF">
<% End If %>
<% If FP_FieldVal(fp_rs,"DateTaken") <> "1/1/2000" AND FP_FieldVal(fp_rs,"DateGraded") = "1/1/2000" Then %>
</font></font>
<td width="79" align="center" height="17"><font face="Arial"><font size="1">
<i><a href="e_<%=vTableName%>.asp?ID=<%=vStudentID%>&EvalID=<%=vEvalID%>&AssignmentID=<%=vAssignmentID%>">View and Evaluate</a></i>
<% End If %></font></font>
</tr>
<!--#include file="../_fpclass/fpdbrgn2.inc"-->
</table>
<p style="margin-top: 10; margin-bottom: 0">
</p>
<!-- Get and Display links to Video files -->
<p style="margin-top: 10; margin-bottom: 0">
</p>
<!-- Get and Display links to Handouts -->
<p style="margin-top: 10; margin-bottom: 0">
</p>
<!-- Get and Display links to Exercise files -->
<p style="margin-top: 10; margin-bottom: 20">
</p>
<tr>
<td width="100%">
<!-- Display Upload Form -->
<!-- Scriptless browsers will not show progress bar but upload will go on as usual. -->
<script language="javascript">
<!--
function ShowProgressBar() {
var Form = document.MyForm;
var ID = (new Date()).getTime() % 1000000000; // Generate unique integer for upload ID
Form.action = "evaluator_file_uploader.asp?ID=<%=vID%>";
var URL = "Progress.asp?ID=" + ID;
var Ver = navigator.appVersion;
var I = Ver.indexOf("MSIE");
if (I > -1 && Ver.charAt(I + 5) > 4) // IE 5 or later
window.showModelessDialog(URL, null, "dialogWidth=320px; dialogHeight:170px; help:no; status:no; resizable:yes; scroll:no");
else
window.open(URL, "_blank", "left=240,top=240,width=320,height=150,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,directories=no");
}
//-->
</script>
<b><font face="Arial" size="2">Upload New Sound Files</font></b><tr>
<td width="100%">
</font></p>
<form name="MyForm" onsubmit="ShowProgressBar()" action="evaluator_file_uploader.asp?StudentID=<%=vStudentID%>&StudentAccessLevel=<%=vStudentAccessLevel%>" enctype="multipart/form-data" method="post">
<p align="center"><font face="Arial" size="2">Select
File to upload:<br>
</font>
<br>
<input type="hidden" name="StudentID" value="<%=vStudentID%>">
<input type="hidden" name="StudentAccessLevel" value="<%=vStudentAccessLevel%>">
<input type="file" name="File1" size="20">
<i><font face="Arial" size="2">(please only upload .mp3 files)</font></i><br><br>
<input type="submit" value="Upload"> </p>
</form>
<tr>
<td width="100%">
</table>
</center>
</div>
</center>
</div>
</body>
</html> Stephen
|
|
|
|
BeTheBall
Posts: 6359 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Passing parameter question - 2/1/2006 11:29:32
You cannot use request.form following the submission of a upload form. http://support.persits.com/show.asp?code=PS01041843
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
sgreen0
Posts: 726 From: Long Beach, CA, USA Status: offline
|
RE: Passing parameter question - 2/1/2006 11:38:12
I'm sorry, I don't understand. The upload code on the pages you referenced are all well below the requests at the top of the page. Stephen
|
|
|
|
BeTheBall
Posts: 6359 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Passing parameter question - 2/1/2006 11:43:49
Yes, but when you click the submit button on Evaluator_Student_Status_Page.asp, the type of form you are submitting is a multipart (upload) form meaning that you cannot use request.form on the next page. I have done very little uploading, but if I understand correctly on the page the upload form submits to you would want to do the uploading first and then use upload.form("fieldname") to get the other field values.
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
sgreen0
Posts: 726 From: Long Beach, CA, USA Status: offline
|
RE: Passing parameter question - 2/1/2006 11:45:16
It seems to me that, if anything, that would apply to fields within the form - which would include my attempt at hidden fields. But it doesn't seem to apply to parameters passes in the URL... What code (using Upload.Save or one of the other suggestions) would apply to those? Thanks. Stephen
|
|
|
|
BeTheBall
Posts: 6359 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Passing parameter question - 2/1/2006 11:49:22
Read my post previous to this one. The fact that you arrive at page 3 by submitting a multipart form makes it so you cannot use request.form nor request.querystring. The proper thing to do is to first take care of the upload and then use upload.form("formvalue") to get the form values.
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
sgreen0
Posts: 726 From: Long Beach, CA, USA Status: offline
|
RE: Passing parameter question - 2/1/2006 11:57:17
Sorry, Duane! Our posts crossed. I'll give it a try. However, the reason I'm so confused about this is that I copied this whole routine from another that works fine. Page 1: <!-- #include virtual="/spooky_protection_lyric.inc" -->
<% Dim vTableName, vUploadType
vUploadType=Request.Querystring("UploadType")
vTableName=Request.Querystring("TableName")
%>
<!-- Scriptless browsers will not show progress bar but upload will go on as usual. -->
<script language="javascript">
<!--
function ShowProgressBar() {
var Form = document.MyForm;
var ID = (new Date()).getTime() % 1000000000; // Generate unique integer for upload ID
Form.action = "lyric_file_uploader.asp?ID=<%=ID%>&TableName=<%=vTableName%>&UploadType=<%=vUploadType%>";
var URL = "Progress.asp?ID=" + ID;
var Ver = navigator.appVersion;
var I = Ver.indexOf("MSIE");
if (I > -1 && Ver.charAt(I + 5) > 4) // IE 5 or later
window.showModelessDialog(URL, null, "dialogWidth=320px; dialogHeight:170px; help:no; status:no; resizable:yes; scroll:no");
else
window.open(URL, "_blank", "left=240,top=240,width=320,height=150,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,directories=no");
}
//-->
</script>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body bgcolor="#000000" link="#000000" vlink="#000000">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="750">
<tr>
<td width="750" colspan="2" background="http://www.writingmusicaltheatre.com/images/lyricbanner.jpg" height="110"> </td>
</tr>
<tr>
<td width="150" background="http://www.writingmusicaltheatre.com/images/lyricsidebar.jpg"> </td>
<td width="600" background="http://www.writingmusicaltheatre.com/images/lyricbackground.jpg">
<p style="margin-left: 40; margin-top:15" align="center"><i><font size="4" face="Arial">
SUBMIT ASSIGNMENT BY UPLOAD</font></i></p>
<p align="left" style="margin-left: 15; margin-right: 20"><font face="Arial">
Upload your Assignment using the form below. Click the Browse button to
locate the file on your own computer, and then click Upload to send that file to
the writingmusicaltheatre.com website. </font></p>
<p align="left" style="margin-left: 15; margin-right: 20; margin-bottom:35"><font face="Arial">Your
file MUST be in a pdf format (i.e., with the extension of .pdf). If you do
not know how to make a pdf file, please visit the Help Desk for some helpful
tips. If you have any difficulties uploading from this page, please
contact the Webmaster.</font>
<!-- To remove progress bar, delete onsubmit event below. -->
</font></p>
<form name="MyForm" onsubmit="ShowProgressBar()" action="lyric_file_uploader.asp?TableName=<%=vTableName%>&UploadType=<%=vUploadType%>" enctype="multipart/form-data" method="post">
<p align="center"><font face="Arial">Select
File to upload:</font><br>
<br>
<input type="file" name="File1" size="20"><br>
<br>
<input type="submit" value="Upload"> </p>
</form>
<p align="center">
<input type="button" name="Cancel" value="CANCEL" onClick='document.location.replace("http://www.writingmusicaltheatre.com/lyric/default.asp")' style="border:1px solid #FFFF00; font-family: Arial; font-size: 10pt; color: #FFFF00; font-weight: bold; width:74; height:25; background-color:#808000">
</p>
</p>
<p> </td>
</tr>
</table>
</center>
</div>
</body></html> Page 2: <%@language=vbscript%>
<!-- #include file="Upload.asp" -->
<% Dim vTableName, vUploadType
vUploadType=Request.Querystring("UploadType")
vTableName=Request.Querystring("TableName")
%>
<%
dim Uploader, File, Name, Items
'Get reference to ASPUploader:
set Uploader = GetASPUploader
'Set Upload Folder
Uploader.Destination = "../Student_Uploads/" & Session("uID")
'ID is needed for progress bar only:
Uploader.ID = Session("uID")
'To restrict file types (file extensions) that users can upload, uncomment and edit this list:
'Uploader.ValidFileTypes = "doc,rtf,pdf,htm,xml,jpg,bmp,gif,png,swf"
'Limit total upload size:
Uploader.MaxTotalBytes = 2000000000
'By default, if uploaded file already exists in Destination, a number is appended to the name of new file.
'In order to overwrite existing files having the same name as the uploaded files, uncomment this:
Uploader.Overwrite = true
'By default, ASPUploader automatically deletes incomplete files of unsuccessful (or canceled) uploads.
'If you do not want ASPUploader to delete such incomplete files, uncomment this:
'Uploader.DeleteIncomplete = false
'Set longer timeout for large files if needed:
Server.ScriptTimeout = 900
'You can upload files directly to their destination folder. But it is a good practice to use a
'temporary folder for files being uploaded and then move completed files to their final destination.
'This way ensures the final destination will never contain incomplete files even if you shutdown
'your web server during upload or if electric power outage occurs.
'Use either physical (C:\Temp), relative (..\Temp), or virtual (/Temp) paths:
Uploader.Destination = "/Temp"
'If user cancels upload or attempts to upload files of invalid (unallowed) type or size, ASPUploader will
'raise an exception (error) with relevant descrition. Enable error handling to catch and handle such errors:
on error resume next
'Start receiving and saving file(s):
Uploader.Upload
'Check for error:
if Err then
Response.Write Err.Source & ": " & Err.Description
Response.End
end if
'The upload is successful (not canceled and no errors), if Err.Number = 0.
'Move all uploaded files to their final destination:
for each File in Uploader.Files.Items
'File.Move "../Student_Uploads/" & Session("uID") &"\"
'Note: Path separator "\" means that "Upload\" is folder (not file) where to move the file (see manual).
next
'Instead of moving all files to single destination, you could move each file to its own (different)
'destination, if needed. For example, to move the first file to folder "C:\Special", uncomment this:
'if Uploader.Files.Exists("File1") then Uploader.Files("File1").Move "C:\Special\"
'Note: "File1" is the input name of field that we have used in the html form for the first file.
'You can move a file and at the same time change its name with a single call to Move method. For example, to
'move the second file to folder "C:\Special" and change its filename to "User_DateTime.zip", uncomment this:
if Uploader.Files.Exists("File1") then Uploader.Files("File1").Move "../Student_Uploads/" & Session("uID") & "\" & vTableName & ".pdf"
'Note: You can use Copy method the same way. Also, Delete and Rename methods are available (see manual).
'Read properties of each uploaded file:
'Response.Write "You uploaded " & Uploader.Files.Count & " file(s)" & "<hr>"
'for each File in Uploader.Files.Items
' Response.Write "Filename: " & File.Name & "<br>"
' Response.Write "Size: " & File.Size & " bytes<br>"
' Response.Write "Content type: " & File.ContentType & "<br>"
'Response.Write "Client path: " & File.ClientPath & "<br><hr>"
' next
'Read values of each field of html form:
' Response.Write "You submitted the following form fields:<br>"
'for each Name in Uploader.Form
' Response.Write Name & ": " & Uploader.Form(Name) & "<br>"
' next
'Response.Write "<hr>"
'Response.Write "Accessing individual files and form fields (see source code):<br>"
'Access uploaded files individually by either input name or index:
'if Uploader.Files.Exists("File1") then
' Response.Write "Name of File1 is " & Uploader.Files("File1").Name & "<br>" 'access by input name ("File1")
' Items = Uploader.Files.Items
' Response.Write "Size of the first file is " & Items(0).Size & " byte<br>" 'access by index (0 is index of the first file)
'end if
'Access values of form fields individually by either input name or index:
'Response.Write "Value of Text1 field is " & Uploader.Form("Text1") & "<br>" 'access by input name ("Text1")
'Items = Uploader.Form.Items
'Response.Write "Value of the second field is " & Items(1) 'access by index (1 is index of the second field)
'Check for errors:
if Err then
Response.Clear
Response.Write Err.Source & ": " & Err.Description
else
response.redirect "http://www.writingmusicaltheatre.com/lyric/Assignments/" & vTableName & "_done.asp?UploadType=" & vUploadType
end if
%> Thanks. Stephen
|
|
|
|
sgreen0
Posts: 726 From: Long Beach, CA, USA Status: offline
|
RE: Passing parameter question - 2/1/2006 15:11:10
Well, I soved the problem by using Session variables instead. That way they didn't need to be passed. I still don't know why the other upload page works with passed variables... Thanks for your help. Stephen
|
|
|
|
sgreen0
Posts: 726 From: Long Beach, CA, USA Status: offline
|
RE: Passing parameter question - 2/5/2006 3:40:12
I thought I'd update the issue. The ASPuploader script allows for other (non-file) fields. They need to be accessed using the Uploader's method, instead of Request.Querystring. vStudentID=Uploader.Form("StudentID")
vStudentName=Uploader.Form("StudentName")
vStudentEmail=Uploader.Form("StudentEmail")
vTableName=Uploader.Form("TableName")
vAssignmentName=Uploader.Form("AssignmentName")
vAssignmentID=Uploader.Form("AssignmentID")
I still have one bothersome problem. Variable values with spaces are unpredictably cut short at the space. I haven't figured out a pattern to this... Thanks for all your help. Stephen
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|