[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FTPAPI



Sender: "Elbert Cook" <elbert@xxxxxxxxxxxxxxx>

Here is the format I used, I assume its correct, it worked.

Sendfile.txt in IFS:

--TestBoundary
content-disposition: form-data; name="operation"
Content-Type: text/plain

UPLOAD
--TestBoundary
content-disposition: form-data; name="data_format"
Content-Type: text/plain

A
--TestBoundary
Content-Disposition: form-data; name="sourcefile"; filename="Sendfile.txt"
Content-Type: text/plain

<file data>
<file data>
<file data>
--TestBoundary--

 Eval      rc = http_url_post_stmf(www.abc.com/servlet/MailboxServlet:
           '/ifs/Sendfile.txt':
           '/ifs/Response.html':
           30:
           'MOZILLA/5.0 (X11; U; OS400)':
           'MULTIPART/FORM-DATA; BOUNDARY=TESTBOUNDARY')



----- Original Message ----- 
From: "Scott Klement" <sk@xxxxxxxxxxxxxxxx>
To: <ftpapi@xxxxxxxxxxxxx>
Sent: Wednesday, August 25, 2004 12:08 PM
Subject: Re: FTPAPI


> Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>
>
>
> Hi Elbert,
>
> Cool!  I'm glad you got it working.
>
> Since this is the 2nd time this has come up this month, I think I'll work
> on some multipart/form-data routines for HTTPAPI.
>
>
> ---
> Scott Klement  http://www.scottklement.com
>
> On Wed, 25 Aug 2004, Elbert Cook wrote:
>
> > Sender: "Elbert Cook" <elbert@xxxxxxxxxxxxxxx>
> >
> > I figured it out and got a successful send.
> >
> >
> > ----- Original Message -----
> > From: "Elbert Cook" <elbert@xxxxxxxxxxxxxxx>
> > To: <ftpapi@xxxxxxxxxxxxx>
> > Sent: Wednesday, August 25, 2004 10:34 AM
> > Subject: Re: FTPAPI
> >
> >
> > > Sender: "Elbert Cook" <elbert@xxxxxxxxxxxxxxx>
> > >
> > > Ok, I think I'm beginning to understand what is involved in uploading
the
> > > file.
> > >
> > > But what about the other values 'operation=UPLOAD' and
'data_format=A'. Do
> > > they also get imbedded in the stream file.
> > >
> > > Webpage html
> > > form METHOD="POST" ENCTYPE="multipart/form-data"
> > > ACTION="/servlet/MailboxServlet"
> > > <input TYPE="HIDDEN" NAME="operation" VALUE="UPLOAD">
> > > <input type="radio" name="data_format" value="A" checked>
> > > <input type="FILE" name="sourcefile" value="testfile" size="25"
> > > maxlength="1024">
> > >
> > >
> > > Sendfile.txt in IFS:
> > > --TestBoundaryTestFile
> > > Content-Disposition: form-data; name="sourcefile";
filename="Sendfile.txt"
> > > Content-Type: text/plain
> > >
> > > <actual file data goes here>
> > > --TestBoundaryTestFile--
> > >
> > > RPG:
> > > rc = http_url_post_stmf('www.abc.com/servlet/MailboxServlet':
> > >     '/Sendfile.txt':
> > >     '/response.html':
> > >     90:
> > >     'Mozilla/5.0 (X11; U; OS400)':
> > >     'multipart/form-data; boundary=TestBoundaryTestFile')
> > >
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: "Scott Klement" <sk@xxxxxxxxxxxxxxxx>
> > > To: <ftpapi@xxxxxxxxxxxxx>
> > > Sent: Tuesday, August 24, 2004 4:40 PM
> > > Subject: Re: FTPAPI
> > >
> > >
> > > > Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>
> > > >
> > > >
> > > > You'll have to create a stream file that's multipart/form-data
encoded.
> > > > HTTPAPI has routines for URL Encoding, but not multipart/form-data
(yet)
> > > >
> > > > Once you have that space created, you can upload them with the
> > > > http_url_post_stmf() routine in HTTPAPI.
> > > >
> > > > I wrote some info about this to Dave Parnin a few weeks ago. Here's
a
> > link
> > > > to that message:
> > > >   http://www.scottklement.com/archives/ftpapi/200408/msg00001.html
> > > >
> > > > ---
> > > > Scott Klement  http://www.scottklement.com
> > > >
> > > >
> > > >
> > > >
> > > > On Tue, 24 Aug 2004, Elbert Cook wrote:
> > > >
> > > > > Sender: "Elbert Cook" <elbert@xxxxxxxxxxxxxxx>
> > > > >
> > > > > Still can't get the FTP connection to work. The bank says its the
way
> > > they
> > > > > NAT and that I'm probably out of luck.
> > > > >
> > > > > However I found out they have a https website for uploading and
> > > downloading
> > > > > files.
> > > > >
> > > > > I've downloaded the beta version of HTTPAPI and I'm playing with
it.
> > > > > I have successfully logged-on and logged-off from the bank and I'm
> > ready
> > > to
> > > > > try uploading a file.
> > > > >
> > > > > But I'm not sure of how to upload a file.
> > > > >
> > > > > Decoding their webpage I have.
> > > > >
> > > > > <form METHOD="POST" ENCTYPE="multipart/form-data"
> > > > > ACTION="/servlet/MailboxServlet"
> > > > > <input TYPE="HIDDEN" NAME="operation" VALUE="UPLOAD">
> > > > > <input type="radio" name="data_format" value="A" checked>
> > > > > <input type="FILE" name="sourcefile" value="testfile" size="25"
> > > > > maxlength="1024">
> > > > >
> > > > > Do I post the filename, or the file data, do I use the
url_post_stmf
> > > > > command?
> > > > >
> > > > > POST  'https://www.abc.com/servlet/MailboxServlet'
> > > > > with parms 'operation=UPLOAD&data_format=A&sourcefile= {Filename
or
> > the
> > > > > ascii file data}'
> > > > >
> > > > > Prehaps I'm completely missing the boat on how an upload works.
> > > > >
> > > > > Sorry for all the novice question,
> > > > >
> > > > >
> > >
> >
> -----------------------------------------------------------------------
> > > This is the FTPAPI mailing list.  To unsubsribe from the list send
mail
> > > to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi
mymailaddr
> >
> -----------------------------------------------------------------------
> >
> > -----------------------------------------------------------------------
> > This is the FTPAPI mailing list.  To unsubsribe from the list send mail
> > to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
> > -----------------------------------------------------------------------
> >
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubsribe from the list send mail
> to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
> -----------------------------------------------------------------------

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------