Forums

This topic is locked

Pure ASP Upload / attach Uploaded file to email

Posted 12 Jun 2003 17:45:52
1
has voted
12 Jun 2003 17:45:52 Scott Burtscher posted:
I'm trying to attach an uploaded file to an HTML email and I have a javascript function that passes all of my form variables (including trimmed file name) to a new window (asp script) that sends an HTML email with the uploaded file attached. This works except for the fact that I have no good way to know if the file has finished uploading.

So my question is: Is there a way I could run my javascript function from within the incPureUpload.asp file once the file has hit the server? Or can I add my HTML Email code to incPureUpload.asp?

Replies

Replied 13 Jun 2003 09:11:46
13 Jun 2003 09:11:46 Martha Graham replied:
The Pure ASP Upload add on pack will let you mail uploaded files. For more details go here: www.dmxzone.com/go?3331

Martha Graham
DMXzone manager
Replied 13 Jun 2003 17:01:56
13 Jun 2003 17:01:56 Scott Burtscher replied:
That looks like a very good extension, but I don't know that it has the full functionality that I need. I also need to package the rest of my form into the email. From the documentation on the Add On Pack it appears as if the email body is generic.

Does anyone know if I can pull my form data out of the pau_BuildUploadRequest sub procedure? I'm not an ASP Guru, but it appears to me that this Sub is using Binary Read to cycle through my form and locate the file to upload.

Can I alter the "Else" statement in the following code to locate the values of my non-file fields in the submitted form?

If PosFile<>0 AND (PosFile<PosBound) Then
'Get Filename, content-type and content of file
PosBeg = PosFile + 10
PosEnd = InstrB(PosBeg,RequestBin,pau_getByteString(chr(34)))
FileName = pau_getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
FileName = pau_RemoveInvalidChars(Mid(FileName,InStrRev(FileName,"\"+1))
'Add filename to dictionary object
UploadControl.Add "FileName", FileName
Pos = InstrB(PosEnd,RequestBin,pau_getByteString("Content-Type:")
PosBeg = Pos+14
PosEnd = InstrB(PosBeg,RequestBin,pau_getByteString(chr(13)))
'Add content-type to dictionary object
ContentType = pau_getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
UploadControl.Add "ContentType",ContentType
'Get content of object
PosBeg = PosEnd+4
PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
Value = FileName
ValueBeg = PosBeg-1
ValueLen = PosEnd-Posbeg
Else
'Get content of object
Pos = InstrB(Pos,RequestBin,pau_getByteString(chr(13)))
PosBeg = Pos+4
PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
Value = pau_getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
ValueBeg = 0
ValueEnd = 0

Reply to this topic