Results 1 to 5 of 5

Thread: Internet Transfer Control -> POST

  1. #1

    Thread Starter
    Hyperactive Member brenaaro's Avatar
    Join Date
    Sep 2001
    Location
    Montreal, Canada
    Posts
    391

    Internet Transfer Control -> POST

    I'm trying to use the MS Internet Transfer Control to POST data to a CGI script. I have the URL correct, and I *believe* the data is formatted properly‡, but what I don't know is what needs to be placed in the InputHeaders argument.

    What I am sending to the CGI script is a MIME encoded HTML email message, from a VB App ...can anyone tell me what I would need to put as headers?

    ‡The script is running on a UNIX machine, and someone told me that there may be an issue with CrLf's, but I'm not sure what is true. All my lines are terminated by CrLf.
    And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.

  2. #2
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Earth
    Posts
    762

    Cool

    any one know???????

    the same prob with me also....

  3. #3
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    Why don't you try using vbCr and vbLf seperately. One of them should succeed. If you get through, please post the code.

  4. #4
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    And also post the code for creating POST data also.

  5. #5

    Thread Starter
    Hyperactive Member brenaaro's Avatar
    Join Date
    Sep 2001
    Location
    Montreal, Canada
    Posts
    391
    I did try replacing all vbCrLf with just vbCr or just vbLF but it did not work..

    I will try some more stuff, but this is the code I am using.
    VB Code:
    1. If InStr(1, sMimeSource, "This is a multi-part message in MIME format.") = 0 Then
    2.    
    3.         sMimeSource = vbCrLf & vbCrLf & vbCrLf & vbCrLf & "This is a multi-part message in MIME format." & vbCrLf & vbCrLf & sMimeSource
    4.    
    5.     End If
    6.  
    7.     'Here's what I try to post. All of the field names are correct
    8.     sPostData = "mailto=" & SendTo & "&mailfrom=" & SendFrom _
    9.     & "&subject=" & SendSubject & "&maildata=" & sMimeSource
    10.  
    11.      'This is what I pass to the .Execute method. I don't know if the
    12.      'InputHeaders parameter is correct...
    13.     .Execute URL_MY_CGI, "POST", sPostData, "Content-Type: application/x-www-form-urlencoded"

    I tried passing sMimeSource as the actual MIME encoded email, in which case I got a blank email back from the server with some AT00001.txt file attached (empty)

    I also tried passing the MIME through this function that someone else on these boards posted (which takes WAY TOO LONG ~88 seconds) to convert..and still does not work.

    VB Code:
    1. 'Encodes a string in www-form-url format
    2. Private Function Encode_x_www_form_url(Data As String) As String
    3.     Dim strOutput   As String
    4.     Dim intAsc      As Integer
    5.    
    6.     Do Until sData = ""
    7.  
    8.         intAsc = Asc(Mid(Data, 1, 1))
    9.        
    10.         Select Case intAsc
    11.    
    12.             ' Case 0-9, A-Z, a-z, SP, :, ;, /, \, ?, @, &, =, +, , , $
    13.             Case 48 To 57, 65 To 90, 97 To 122, 46, 58, 59, 47, 92, 63, 64, 38, 61, 43, 44, 36 'Alphanumeric characters
    14.                 strOutput = strOutput & Chr(intAsc)
    15.    
    16.             Case 32 'Space
    17.                 strOutput = strOutput & "+"
    18.              
    19.                
    20.             Case Else 'Any non alphanumeric character.
    21.                
    22.                 If intAsc <= 10 Then
    23.                     strOutput = strOutput & "%0" & Hex(intAsc)  'Pad
    24.                 Else
    25.                     strOutput = strOutput & "%" & Hex(intAsc)
    26.                 End If
    27.                
    28.         End Select
    29.    
    30.         Data = Mid(Data, 2)
    31.        
    32.     Loop
    33.        
    34.     Encode_x_www_form_url = strOutput
    35.    
    36. End Function
    And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width