View Full Version : un-set objUpload
Boxhead
01-05-2004, 05:23 PM
I am using a piece of code called Upload3 http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=8525&lngWId=4
I have a form where several fields are filled in, in the style of an email page. The info is then sent to a page that I want to upload the file to the server, build the email, attach the uploaded file from the server, send the email and delete the uploaded file.
The problem is the second stage. After the file has been uploaded, I need to use request.form to get the rest of the information from the email from, but 'access to the Request object is restricted' after Set objUpload = new clsUpload is used.
How can I un-restrict this object after the upload is complete?
hope this makes some sence!!
monkey
fractalvibes
01-05-2004, 06:06 PM
your upload component should have some methods to access the
other form variables. They are not available using the regular Request.Form (because the upload component does a binary read of the raw http form post and you cannot mix the two).
Check the docs on your upload component - there should be a form fields collection available to you.
fv
Boxhead
01-05-2004, 06:14 PM
fv
Sorry but you may need to hold my hand a bit (if you dont mind).
Part of the script has this commented out:
' Field class represents interface to data passed within one field
'
' Two available methods of getting a field:
' Set objField = objUpload.Fields("File1")
' Set objField = objUpload("File1")
'
Is this what I need?
The files are available on the link on my first post - i think the relevant part is in the file called clsField.asp - is there any chance you could have a look and see what you think?
Chhers for your help
monkey
fractalvibes
01-05-2004, 06:23 PM
You are on the right track
Two available methods of getting a field:
' Set objField = objUpload.Fields("File1")
' Set objField = objUpload("File1")
Try this to see what you get:
' response.write objUpload.Fields("field1") & "<br>"
' response.write objUpload.Fields("field2") & "<br>"
and so forth
and lastly
response.end
to see what you wrote out
etc. for all the form fields you need to capture.
of course substitute "field1", etc. for your actual form field names.
fv
Boxhead
01-06-2004, 12:14 PM
FV
excellent - works a treat. I now have another problem. I want the message I am sending to be in an html format but when I send it I di=ont get the desired results (far from it).
here are the results I get - can you see any glaringly obveous problems?( i can post the asp code if you cant find the problem from here):
Date: Tue, 6 Jan 2004 10:36:01 -0000
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0016_01C3D440.E1165B00"
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
This is a multi-part message in MIME format.
------=_NextPart_000_0016_01C3D440.E1165B00
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
=09
=09
=09
me and you ,
this is the body oh jrts ehg fdhtfd hfg fgs hg=20
this is the close=20
from me=20
Email Address: this is my email <mailto:this is my email=00 >=20
***************************************************************************=
*******************
This communication is intended for the person(s) or organisation named.
It may be confidential, legally privileged and protected in law.=20
The unauthorised disclosure, copying or use of this information may be unla=
wful.
***************************************************************************=
*******************
------=_NextPart_000_0016_01C3D440.E1165B00
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC"-//IETF//DTD HTML//EN"><html><head><title></title><st=
yle type=3D"text/css"><!--body {background-color:#FFFFCC; font-family: Aria=
l, Helvetica, sans-serif; font-size: 10pt; margin:0px 0px 0px 0px; }table.s=
ide {background-repeat: repeat-y}--></style></head><body><table width=3D"10=
0%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0"><tr><td width=3D"75"><=
img src=3D"http://www.mysite.uk/assets/template/top.gif" width=3D"76=
" height=3D"2" alt=3D"" /></td><td width=3D"55" rowspan=3D"2"><img src=3D"h=
ttp://www.mysite.uk/assets/template/top_left.gif" width=3D"55" heigh=
t=3D"31" alt=3D"" /></td><td width=3D"100%" rowspan=3D"2" background=3D"htt=
p://www.mysite.uk/assets/template/top_bar.gif" class=3D"repx"> =
</td><td width=3D"3" rowspan=3D"3"><img src=3D"http://www.mysite.uk/=
assets/template/top_end.gif" width=3D"3" height=3D"89" alt=3D"" /></td><td =
width=3D"10"><img src=3D"http://www.mysite.uk/assets/spacer.gif" wid=
th=3D"1" height=3D"2" alt=3D"" /></td></tr><tr><td rowspan=3D"2"><img src=
=3D"http://www.mysite.uk/assets/template/badge.jpg" width=3D"76" hei=
ght=3D"87" alt=3D"" /></td><td><img src=3D"http://www.mysite.uk/asse=
ts/spacer.gif" width=3D"1" height=3D"29" alt=3D"" /></td></tr><tr><td><img =
src=3D"http://www.mysite.uk/assets/template/email_temp_06.gif" name=
=3D"Image1" width=3D"55" height=3D"58" border=3D"0" id=3D"Image1" /></td><t=
d align=3D"center"><img src=3D"http://www.mysite.uk/assets/template/=
email_title.gif" width=3D"553" height=3D"58" alt=3D"" /></td><td><img src=
=3D"http://www.mysite.uk/assets/spacer.gif" width=3D"1" height=3D"58=
" alt=3D"" /></td></tr></table><table class=3D"side" width=3D"96%" height=
=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"0"><tr><td width=3D=
"2%" background=3D"http://www.mysite.uk/assets/template/email_temp_0=
8.gif"><img src=3D"http://www.mysite.uk/assets/spacer.gif" width=3D"=
55" height=3D"100" /></td><td width=3D"98%" valign=3D"top">me and you
,<p>this is the body
oh
jrts
ehg
fdhtfd
hfg
fgs
hg
</p>this is the close
<br />from me
<br /><p style=3D"font-size:10pt">Email Address: <a href=3D"mailto:this is =
my email
">this is my email
</a></p></td></tr></table><CODE><FONT SIZE=3D3><BR>
<BR>
***************************************************************************=
*******************<BR>
This communication is intended for the person(s) or organisation named.<BR>
It may be confidential, legally privileged and protected in law. <BR>
The unauthorised disclosure, copying or use of this information may be unla=
wful.<BR>
***************************************************************************=
*******************<BR>
</FONT></CODE>
</body></html>
------=_NextPart_000_0016_01C3D440.E1165B00--
glenngv
01-06-2004, 01:38 PM
http://www.codingforums.com/showthread.php?s=&threadid=30218
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.