[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Receiving file via HTTP
Here is some very simple code for a multipart/form-data:
<form name="form1" method=post enctype="multipart/form-data"
action="[1]http://5.103.128.110:6382/pextcgicor/filetest.pgm" >
<input type="file" name="browserfile" size="40" device="files"></td>
<input type="submit" value="Upload">
</form>
�/copy qsrc,pxapihdr � � �General H-Spec's � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� �* powerEXT API Connectors � � � � � � � � � � � � � � � � � � � �/copy qsrc,pxapicgicn � �Basic HTTP connecter & Basic Services� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� �* Declare Internal Variables � � � � � � � � � � � � � � � � �� d pcfile � � � � �s � � � � � 1024a � varying � � � � � � � � �� d ifsfile � � � � s � � � � � 1024a � varying � � � � � � � � �� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� �/free � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � clearsrvpgm(); � � � � � � � � � � � � � � � � � � � � � � � � � getExtInput(); � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � PCfile = getExtvar('browserfile'); � � � � � � � � � � � � � � � IFSfile = getExtvar('browserfile_tempfile'); � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � // This code just send the data back to the browser � � � � �� � setContent('text/html'); � � � � � � � � � � � � � � � � � � � � echo('<h1>File ' + PCfile + ' Received</h1><p>'); � � storeFromStmf(0:ifsfile); � � � � � � � echoToClient(); � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � qcmd('DEL' � � � � � � � � � � � � �� � �+ ' OBJLNK(''' + IfsFile + ''')'); � � � � � � � � � � � � � � � � � � � � � � *inlr = *on; � � � � � � � � � � � �� �/end-free � � � � � � � � � � � � � � � � � � ��
On Wed, Aug 28, 2013 at 8:13 PM, Henrik Rützou <[2]hr@xxxxxxxxxxxx>
wrote:
Hi Brian,
how will the file be uploaded, as an attachement on
a�multipart/form-data FORM or� as parameter in a normal FORM/POST?
On Wed, Aug 28, 2013 at 7:41 PM, Brian <[3]belstsrv@xxxxxxxxx> wrote:
Hi Henrik,
Do you have any simple examples of setup of powerEXT over HTTP for
receiving a file?
Thanks!
On 8/28/2013 12:54 PM, Henrik Rützou wrote:
� � Brian,
� � if your partner wants to push a file it can be done with both
CGIDEV2
� � or powerEXT
� � over HTTP (your partner is the HTTP Client and your IBM I is the
� � server)
� � It can either be done as a multipart/form-data or as a normal
POST�
� � On Wed, Aug 28, 2013 at 6:44 PM, Henrik Rützou
<[1][4]hr@xxxxxxxxxxxx>
� � wrote:
� � Mike,
� � powerEXT Core is actually only an extension of CGIDEV2 and has
its own
� � version running
� � "under the hood" that comes with the package
� � [2][5]http://184.172.184.159/~servus/pextdrupal/sites/all/themes/the
me548/
� � images/powerEXT_Core.png
� � The big difference is really that powerEXT Core is made for
generating
� � and READING formats like XML and
� � JSON inline to support WEB 2.0 development. Most CGIDEV2 program
will
� � also run on powerEXT Core
� � so you more or less just have to include the powerEXT Core
library
� � instead of the CGIDEV2 library and�
� � recompile.
� � On Wed, Aug 28, 2013 at 6:04 PM, Mike Krebs
� � <[3][6]mkrebs@xxxxxxxxxxxxxxxxxx> wrote:
� � � A few years ago, while playing with CGIDEV2, I created a "web
page"
� � � that was a post with a "large FORM field" for data. I used
HTTPAPI
� � � to post the document to this "web page". It worked for the
test
� � � using small files (that fit into variables). I was sending
small csv
� � � files. I looked in our old intranet pages and I couldn't find
my
� � � example, but I know I hacked it together using CGIDEV2 on the
server
� � � side.
� � � If your partner can create a HTTPAPI like connection, that
solves
� � � two issues for you. One, you will know when the document is
received
� � � (a problem with monitoring IFS directories). Two, it is very
easy to
� � � create a "web page" that accepts a file. You could use an
actual web
� � � page if that works or you could just use the POST url to have
� � � CGIDEV2 process the page directly.
� � � Since 2009, it looks like CGIDEV2 now has some extended
support for
� � � this. �
[4][7]http://www.easy400.net/cgidev/html/exhibiv3.htm
� � � More information on another technique:
� � � [5][8]http://www.easy400.net/fupload/html/page3.htm
� � � CGIDEV2 works pretty well and has decent directions on getting
it
� � � running quickly. If you have not worked with APACHE
directives, it
� � � can be frustrating if you want to change where things are
located,
� � � but overall, not too hard to setup or use.
� � -----Original Message-----
� � From: [6][9]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
� � [mailto:[7][10]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf
Of Brian
� � Sent: Wednesday, August 28, 2013 9:43 AM
� � To: [8][11]ftpapi@xxxxxxxxxxxxxxxxxxxxxx
� � Subject: Receiving file via HTTP
� � Hello all,
� � This is not a direct HTTPAPI question, but I am hoping the list
may
� � have
� � some experience or suggestions on this.
� � I have a partner that would like to push a JSON formatted file to
us
� � that we will then parse. � I'd like this connection to be made
to our
� � iSeries and the file dropped off to the IFS where we will pick up
and
� � parse the file.
� � I am thinking of using YAJL or powerEXT for the parsing of the
JSON
� � file.
� � What I really need help on is what/how to set up on the iSeries
to
� � accept the connection for the JSON document to be dropped off to
me.
� � Simple to start would be better as we may have a dedicated
connection
� � to
� � the partner and not need much/any authentication on the HTTP
� � connection.
� � If anyone has info on the best/easiest way to set up something
like
� � this, it would be very much appreciated.
� � Thanks all!
� � -----------------------------------------------------------------------
� � This is the FTPAPI mailing list. � To unsubscribe, please go
to:
� � [9][12]http://www.scottklement.com/mailman/listinfo/ftpapi
� � -----------------------------------------------------------------------
� � -----------------------------------------------------------------------
� � This is the FTPAPI mailing list. � To unsubscribe, please go
to:
� � [10][13]http://www.scottklement.com/mailman/listinfo/ftpapi
� � -----------------------------------------------------------------------
� � --
� � Regards,
� � Henrik Rützou
� � �
� � [11][14]http://powerEXT.com
� � �
� � --
� � Regards,
� � Henrik Rützou
� � �
� � [12][15]http://powerEXT.com
� � �
References
� � 1. mailto:[16]hr@xxxxxxxxxxxx
� � 2.
[17]http://184.172.184.159/~servus/pextdrupal/sites/all/themes/theme
548/images/powerEXT_Core.png
� � 3. mailto:[18]mkrebs@xxxxxxxxxxxxxxxxxx
� � 4. [19]http://www.easy400.net/cgidev/html/exhibiv3.htm
� � 5. [20]http://www.easy400.net/fupload/html/page3.htm
� � 6. mailto:[21]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
� � 7. mailto:[22]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
� � 8. mailto:[23]ftpapi@xxxxxxxxxxxxxxxxxxxxxx
� � 9. [24]http://www.scottklement.com/mailman/listinfo/ftpapi
� �10. [25]http://www.scottklement.com/mailman/listinfo/ftpapi
� �11. [26]http://powerext.com/
� �12. [27]http://powerext.com/
-----------------------------------------------------------------------
This is the FTPAPI mailing list. �To unsubscribe, please go to:
[28]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list. �To unsubscribe, please go to:
[29]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
--
Regards,
Henrik Rützou
� [30]http://powerEXT.com
�
--
Regards,
Henrik Rützou
� [31]http://powerEXT.com
�
References
1. http://5.103.128.110:6382/pextcgicor/filetest.pgm
2. mailto:hr@xxxxxxxxxxxx
3. mailto:belstsrv@xxxxxxxxx
4. mailto:hr@xxxxxxxxxxxx
5. http://184.172.184.159/~servus/pextdrupal/sites/all/themes/theme548/
6. mailto:mkrebs@xxxxxxxxxxxxxxxxxx
7. http://www.easy400.net/cgidev/html/exhibiv3.htm
8. http://www.easy400.net/fupload/html/page3.htm
9. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
10. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
11. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
12. http://www.scottklement.com/mailman/listinfo/ftpapi
13. http://www.scottklement.com/mailman/listinfo/ftpapi
14. http://powerEXT.com/
15. http://powerEXT.com/
16. mailto:hr@xxxxxxxxxxxx
17. http://184.172.184.159/~servus/pextdrupal/sites/all/themes/theme548/images/powerEXT_Core.png
18. mailto:mkrebs@xxxxxxxxxxxxxxxxxx
19. http://www.easy400.net/cgidev/html/exhibiv3.htm
20. http://www.easy400.net/fupload/html/page3.htm
21. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
22. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
23. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
24. http://www.scottklement.com/mailman/listinfo/ftpapi
25. http://www.scottklement.com/mailman/listinfo/ftpapi
26. http://powerext.com/
27. http://powerext.com/
28. http://www.scottklement.com/mailman/listinfo/ftpapi
29. http://www.scottklement.com/mailman/listinfo/ftpapi
30. http://powerext.com/
31. http://powerext.com/
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------