ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

php and as400

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • php and as400

    I program in RPGLE/Free form. I also do some website on the side in all php. I am currently trying to find a way to give our overseas vendors the ability to upload a spreadsheet or csv file from a php website to an as400 file. Is there any documentation on how to begin? I can program in both languages, but I have never put them together.

    Regards,
    Oche

  • #2
    Re: php and as400

    Setup a folder in the IFS to receive FTP files (in this case, CSV files) then have a job on the i5 that monitors the folder for files. When it finds one, do a CPYFRMIMPF to pull the data into your Database table and get busy.

    If you want to spice it up, put a screen up in PHP that prompts them for the local (their hard drive) file name to pull/push... then FTP it to the IFS on your i5.

    Comment


    • #3
      Re: php and as400

      Why could I not have them upload a csv directly into an as400 database file? I would think it was possible. The reason I ask is because I could possible have 20 manufacturers uploading the same file within seconds of each other.

      Comment


      • #4
        Re: php and as400

        I would think you can with all the co-mingling that IBM is doing with Zend.

        If I were you I think I would look to Zend's site

        They would most likely step over each other trying to help you.
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: php and as400

          I thought you were looking for a solution to get the file TO the i5 using PHP -- didn't realize there were more than one coming at the same time. Still, unless they are keyed or something that you might have to watch for... I would think the best bet would be to load them into the IFS and then pull into your table so that you can error check or what have you PRIOR to your needing the data. Data validation and such...

          But, that's just me...

          Comment


          • #6
            Re: php and as400

            Do you "need" Zend to have a php website communicate with the as400?

            Comment


            • #7
              Re: php and as400

              No... the Zend is necessary if you want the AS400 to produce the website. Communication can be made TO the AS400 numerous ways.... just an FTP will do.

              Comment


              • #8
                Re: php and as400

                I would evaluate this process to make sure that using CSV files is the most appropriate way to communicate with each other. It really sounds like more of an XML process to me.
                Michael Catalani
                IS Director, eCommerce & Web Development
                Acceptance Insurance Corporation
                www.AcceptanceInsurance.com
                www.ProvatoSys.com

                Comment


                • #9
                  Re: php and as400

                  A more 21st century alternative to saving directly to the filesystem is to use a BLOB field in your database table.

                  This story talks about Java and JSP's but the technique applies just the same to PHP.
                  Ben

                  Comment

                  Working...
                  X