Re: Http post



Without having access to this website, it is hard for me to test. But what
they seem to need is character string that contains all the information they
require (including the attachment) sent as a parameter, In other words, let
us take the first two things they want:
Content-Disposition: form-data
Content-Type: text/plain
Function=Upload

Now if you were for example to build a string out of these 3 things
lcString = "Content-Disposition: form-data"+"&"+"Content-Type:
text/plain"+"&+"Function=Upload"
? lcString && Just to make sure it looks right.
The second post looks like it needs to be build the same way as your first
one. But then I see they want it as a multipart Mime encoded files.
So if you were to build you string according to their example, it could be
done this way:

lcStr=' -----------------------------7d13e425b00d0'+chr(13)+chr(10)
lcStr=lcStr+' Content-Disposition: form-data;
name="Function"'+chr(13)+chr(10)
lcStr=lcStr+'Upload'+chr(13)+chr(10)
lcStr=lcStr+' -----------------------------7d13e425b00d0'



"W.Davis" <wdavis3@xxxxxxxxxxxxxxxxxx> wrote in message
news:%23OCtGCF4IHA.2580@xxxxxxxxxxxxxxxxxxxxxxx
Mike,
See if the second post (example) strikes a chord with you. I haven't been
able to find examples, although there are google messages about using a
post to upload attachments, just no examples of how to do it.
Wade

Two separate HTTP Post request are required to complete the upload
process. The first authenticates the user on ClaimConnect. And the second
uploads the file as an attachment.

FIRST POST (Parameters for Authentication Request are in the URL below)
The example you (Mike) sent me works fine and the authentication id can be
easily parsed from .responseText

oHttp = Createobject("WinHttp.WinHttpRequest.5.1")
oHttp.Open("POST","http://prelive.dentalxchange.com/dci/upload.svl?&Function=Auth&Source=EDI&Username=foxteeth_test&Password=Wdavis1&UploaderName=[foxteeth]&UploaderVersion=3.0",.f.)
var = 'oHTTP.SetRequestHeader("content-type",
"application/x-www-form-urlencoded")'
oHttp.Send(var)
messagebox(ohttp.responseText)

SECOND POST Parameters for Upload of text file
1) Upload Request
a. Parameters must be sent as a multi-part (MIME) encoded message.
b. Content-Type: multipart/form-data
Form Elements:
Content-Disposition: form-data
Content-Type: text/plain
Parameters:
Function=Upload (CONSTANT; signifies that this is an upload request)
Source=EDI (CONSTANT; file format)
AuthenticationID= (the authentication id returned by the authentication
request)
File; filename="D:\ClaimConnect\UI_EDI_Uploader\claims9.txt"


Example:
-----------------------------7d13e425b00d0
Content-Disposition: form-data; name="Function"
Upload
-----------------------------7d13e425b00d0
Content-Disposition: form-data; name="Source"
EDI
-----------------------------7d13e425b00d0
Content-Disposition: form-data; name="AuthenticationID"
2dd83b0d798b4ab16b4c88575a76ecdae15e6f18a042052a923825f70a015bc068b6a2698af2b241d72ffc4b4aedcf2d906fd15c3f3cce4b4bb05e2d7999380043eef09f8c99f197c6ef893ac78de5f766d175d7ca50256918c78ca0ba83f4e174424555be7892f787825353428a368dbeae63bcbe7a641a8abdbf7bed368a7d8c2eb3981a008b23c2c93322daf36f689ec80501a3731056bf01e16c2d5a3f0385756d9a2e5e57081818a9274706ea9db452194f14980eaa74dafe0aa41e7922840ede3f3f6294
-----------------------------7d13e425b00d0
Content-Disposition: form-data; name="File";
filename="D:\ClaimConnect\UI_EDI_Uploader\myfile_to_upload.txt"
Content-Type: text/plain

2) Upload Response
a. Parameters returned by request:
Status=0&Filename=CL-173740.837&Timestamp=Thu Dec 30 16:45:57 PST 2004&
Parameters:
Status= (status code returned, see statuses below)
EDI_STATUS_SUCCESSFUL = 0
EDI_STATUS_AUTH_FAILED = 1
EDI_STATUS_CANNOT_UPLOAD_AT_THIS_TIME = 2
Filename= (filename of uploaded file on ClaimConnect)
Timestamp= (timestamp)
ErrorMessage= (error message return if status is not 0)







"Mike Gagnon" <mgagnon23@xxxxxxxxxxx> wrote in message
news:%23ChHWhE4IHA.3804@xxxxxxxxxxxxxxxxxxxxxxx
If they were so concerned about moving sensitive data across the
internet, their server would most likely be HTTPS rather than HTPP so
perhaps just simple text string with an attachment (in binary format)
might be all they need.

"W. Davis" <foxteeth@xxxxxxxxxxxx> wrote in message
news:eJ14ylD4IHA.4448@xxxxxxxxxxxxxxxxxxxxxxx
Everything you say is correct, Mike. The server however, expects to
receive
a second Post that includes the text file. I'll get the parameters this
afternoon and show you what they sent me and what they expect. I'm sure
it
can be done, and if I figure it out, it could be a useful foxpro
function.
Also, they may eventually want a digitized xray or MRI as a second
attachment. Because of HIPPA requirements in healthcare, I assume they
don't
feel they can do a simple email.
Wade


"Mike Gagnon" <mgagnon23@xxxxxxxxxxx> wrote in message
news:uxUWeED4IHA.2060@xxxxxxxxxxxxxxxxxxxxxxx
I am not sure I understand, most of time there is a program waiting for
a
string of characters to deal with at the other end, and returns a
response.
But a Mutlipart Mime is normally an e-mail format, and the attachment
is
normally included (something in the format of Base64) incorporated in
the
Multipart Mime.
Without having more info as to what the need, it is hard to say. But it
sound like to me, that the whole string they want is in the format of
an
e-mail message (multipart), and the attachment is one part of the
message,
that they will deal with when they receive it.
For example, if you go to your Outlook inbox folder and right-mouse on
an
e-mail that has an attachment, go to message options, you will see in
the
header portion the words "multipart" (most e-mails are multipart since
there
is a header and a body) and somehwere else you might find the word
"boundary" which determines where the attachment (or whatever part of
the
message it is) starts an what characters delimit the boundary.
But it many not be exactly in an e-mail format they want, it just sound
like
it.

"W. Davis" <foxteeth@xxxxxxxxxxxx> wrote in message
news:eRcmkvC4IHA.1436@xxxxxxxxxxxxxxxxxxxxxxx
Thanks, Mike.... I was able to do the initial post an receive back an
authentication id to begin the final post. That's where I have
stopped
cold.... they want a post in multipart mime, as a text file will be
the
attachment. Any ideas how to go about that?
Wade

"Mike Gagnon" <mgagnon23@xxxxxxxxxxx> wrote in message
news:OvMkB2h3IHA.1420@xxxxxxxxxxxxxxxxxxxxxxx
Look for examples using WinHTTP.WinHTTPRequest

Here is an example with a parameter. The line oHttp.Send is where
the
pameter is, the parameter name is "idmc" and the value of the
parameter
is
"100 Girls"
In this case the messagebox should give you a description of a
movie,
but
most of the time you are sending something to the site, and the site
responds but "OK" of something like that. But you get the idea.
You will find some site prefer the URL format to be more like
oHttp.Open("POST","http://www.moviecovers.com/getfilm.html?&idmc='100
GIRSL',.F.)

Where the url has a question mark at the end of it, then the & sign,
and
the
parameter name and the value>


oHttp = Createobject("WinHttp.WinHttpRequest.5.1")

oHttp.Open("POST", "http://www.moviecovers.com/getfilm.html",.F.)

oHttp.Send("idmc=100 GIRLS")

MESSAGEBOX( ohttp.responseText)


"W.Davis" <wdavis3@xxxxxxxxxxxxxxxxxx> wrote in message
news:uGtk00d3IHA.4448@xxxxxxxxxxxxxxxxxxxxxxx
Group,
We need to use Http Post to send a file (I have Zero experience
with
it)
from vfp 6 to an electronic medical claims site for processing.
They
sent
me the 'parameters', etc. but after googling for info, I found no
examples
of how to do it. Can anyone point me in the right direction? I
don't
know
Http post from a fence post.
TIA,
Wade















.



Relevant Pages

  • Re: Http post
    ... See if the second post strikes a chord with you. ... Two separate HTTP Post request are required to complete the upload process. ... The example you sent me works fine and the authentication id can be ... simple text string with an attachment (in binary format) might be all they ...
    (microsoft.public.fox.programmer.exchange)
  • Re: loading files using eval problem
    ... Pep wrote in message ... I can upload some files which have the following format: ... BTW to put a ' in a string you just have to double it e.g.: ...
    (comp.soft-sys.matlab)
  • ASP.NET Forms Authentication Best Practices
    ... ASP.NET Forms Authentication Best Practices ... What happens if your user database is compromised? ... Listing One, where you want to use login.aspx to log users in. ... string FirstName ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Date format detection
    ... Specifies the locale for which the date string is to be formatted. ... date format for this locale. ... the system default-date format for the specified locale. ... be enclosed within single quotation marks in the date format picture. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Date format detection
    ... > Specifies the locale for which the date string is to be formatted. ... > date format for this locale. ... > the system default-date format for the specified locale. ... > be enclosed within single quotation marks in the date format picture. ...
    (borland.public.delphi.thirdpartytools.general)

Quantcast