multipart/form data to base64 encoding ?? 
Author Message
 multipart/form data to base64 encoding ??

HI All

How do you convert the binary stream sent from a form post using
encType="multipart/form-data" to base 64 for use as an email attachment
using adodb stream objects?

Also how do you control the encoding that the browser uses for sending
binary files ??

In my last post

set StreamAll = server.CreateObject("ADODB.Stream")
StreamAll.Write request.binaryRead(Request.TotalBytes)
...do some byte stuff to get the StartPos, EndPos of the binary file
StreamAll.Position = StartPos-1
set StreamOut = server.CreateObject("ADODB.Stream")
StreamOut.Type = 1 'binary
StreamOut.Write StreamAll.Read(EndPos-StartPos)
StreamOut.Flush 'gotta flush or get out of context error

and the Last part of the story is
set oCDOMsg = server.CreateObject("CDO.Message")
With oCDOMsg
'set Emailto, Emailfrom ...
     Set oBodyPart = .BodyPart.AddBodyPart
     Set oFlds = oBodyPart.Fields
     oFlds("urn:schemas:mailheader:content-disposition") = "attachment;
    filename=""" & FileName & """"
    oFlds.Update
    oBodyPart.ContentTransferEncoding = "base64" ' "binary"
    Set oStream = oBodyPart.GetEncodedContentStream
    oStream.Type = 1 '1-Binary, 2-Text
    oStreamOut.CopyTo oStream
    oStream.Flush
End WITH



Sun, 20 Apr 2003 03:11:34 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. multipart/form-data Need just data string help

2. Server.Transfer does not work with multipart/form data

3. enctype="multipart/form-data"

4. Extracting files from a MIME(multipart/form-data) blob

5. multipart/form-data posting from VB 6??

6. How to send content-type multipart/form-data from VB

7. VB5/ASP Internet Transfer Control and ENCTYPE="MULTIPART/FORM-DATA

8. POST file multipart/form-data

9. How to check if a string is Base64 Encoded

10. Base64 Encoding

11. Base64 Encode

12. Base64 encoding

 

 
Powered by phpBB® Forum Software