ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Visual Basic \ IFS

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

  • Visual Basic \ IFS

    To preface this issue, the task below is being attempted through an SSIS Visual Basic applicaton. The job will run every 1 minute unattended.

    The companies system has a ,tif image file on a company network drive. Upon request from the user on the iSeries needs to email an attachment of the .tif through the iSeries. It is my understanding that that bianary string that the .tif exists as needs to be converted to a base64 type data stream for the iSeries to email. The image has been converted to base64. So now a stream exists of base64 data. How do you get the stream loaded to the iSeries IFS (Integrated File System)?

    Have been looking at cwbx.hlp but it is not very helpful. Maybe that is the wrong approach. If anyone has any suggestions that would be excellent.

  • #2
    Re: Visual Basic \ IFS

    Couldnt the tiff image just be left on the IFS and emailed from there?

    There is a freeware tool call MMAIL you can get it from here


    or the image can be converted (again from the IFS) using Scott's freeware tool
    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


    • #3
      Re: Visual Basic \ IFS

      Originally posted by jamief View Post
      Couldnt the tiff image just be left on the IFS and emailed from there?

      There is a freeware tool call MMAIL you can get it from here


      or the image can be converted (again from the IFS) using Scott's freeware tool
      http://www.scottklement.com/base64/

      Comment


      • #4
        Re: Visual Basic \ IFS

        Jamie, Thanks. But I already have the base64 topic solved. The question is how to get it to the IFS through an unattened Visual Basic application.

        Comment


        • #5
          Re: Visual Basic \ IFS

          Why can the image not be placed directly on the IFS -- You just create a share on the Iseries side..
          I can provide a snippet of code to do this via an RPG program (if you need) then map that drive on the server
          where the unattended vb app is running and have that ap write directly to the IFS..
          then from the green sceen on request from user the image can then be mailed out directly from the iseries using
          MMAIL or you can roll your own using the BASE64 conversion, then email using QtmmSendMail
          PHP Code:
           // start of sendmail copybook                                             
          d QtmmSendMail    PR                  ExtProc('QtmmSendMail')              
          d   FileName                   255A   const options(*varsize)              
          d   FileNameLen                 10I 0 const                                
          d   MsgFrom                    256A   const options(*varsize)              
          d   MsgFromLen                  10I 0 const                                
          d   RecipBuf                          likeds(ADDTO0100)                    
          d                                     dim(32767)                           
          d                                     options(*varsize)                    
          d   NumRecips                   10I 0 const                                
          d   ErrorCode                 8000A   options(*varsize
          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


          • #6
            Re: Visual Basic \ IFS

            You can write the tif image directly to the IFS in VB. Once you create it, just copy it to the IFS thru a mapped netwok drive.
            Michael Catalani
            IS Director, eCommerce & Web Development
            Acceptance Insurance Corporation
            www.AcceptanceInsurance.com
            www.ProvatoSys.com

            Comment


            • #7
              Re: Visual Basic \ IFS

              OK. But how do I do that?

              Comment


              • #8
                Re: Visual Basic \ IFS

                Hi Working:

                I'm getting a little lost here. I get the impression that you are not creating the email but are only providing the .Tif file.

                There are several programs available on the Iseries which will do the Base64 encoding as part of composing the email itself.
                My concern is that you are doing the Base64 conversion and then one of these programs is going to re-encode your already encoded file.

                Please clarify.

                The link below shows how to map an iseries drive to the network/pc

                It's the standard map a network drive stuff.

                Best of Luck
                GLS
                Last edited by GLS400; May 25, 2011, 01:59 PM.
                The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

                Comment


                • #9
                  Re: Visual Basic \ IFS

                  Let's skip the email part. We just have to get a .tif image filestream to the IFS. The question is how to programmically get a .tif filestream to write to the IFS. For example, it must be necessary to provide a user ID and password and a connection string to connect to the iSeries through VB. What technology do I use? A .ddl or some type of OLE or ODBC back end. I know the mapping to the directory on the IFS so it is not that I don't know the location.

                  Comment


                  • #10
                    Re: Visual Basic \ IFS

                    1. RIght click on MyComputer
                    2. Select map a network drive
                    3. Enter a drive letter, and select the path on the machine you want the drive letter to point to. Click reconnect at logon.
                    4. In your VB program, copy the tif file to the drive letter.
                    Michael Catalani
                    IS Director, eCommerce & Web Development
                    Acceptance Insurance Corporation
                    www.AcceptanceInsurance.com
                    www.ProvatoSys.com

                    Comment


                    • #11
                      Re: Visual Basic \ IFS

                      Working:

                      Maybe FTP is the way to go...

                      Just a thought
                      GLS
                      The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

                      Comment


                      • #12
                        Re: Visual Basic \ IFS

                        make a directory from system i navigator --or-- greenscreen
                        PHP Code:
                        MD DIR('home/workingforyou'DTAAUT(*RWXOBJAUT(*ALL
                        then share if from the system i side.
                        (see image) -- or -- again I have rpg code that can do this on the fly...

                        --------------- now on your server -------------------------

                        goto network.... look for system i -- click it and find your share..(second image)
                        now map it and have your vb app write directly to IFS.
                        Attached Files
                        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


                        • #13
                          Re: Visual Basic \ IFS

                          Thanks for the responses. The question is not about an email or mapping a drive or conversion to base64. That is all solved. I was hoping that someone could point me in the direction of the best technology to use to get to the IFS from Visual Basic. Did not want to have to code anything on the iSeries. Just deposit a file on it. Wanted to accomplish this task through Visual Basic. There is something called a cwbx.dll and a couple of other ideas. The Visual Basic forums must not deal with the iSeries because I could find anything. Hoping this would be the place.

                          Anyone have some Visual Basic or C# code that does something like this? At least would have some direction.

                          Thanks.

                          Comment


                          • #14
                            Re: Visual Basic \ IFS

                            what you are asking for is exactly what we gave you...I am now in complete confusion.
                            Please send help!

                            jamie
                            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


                            • #15
                              Re: Visual Basic \ IFS

                              Originally posted by WorkingForYou View Post
                              Thanks for the responses. The question is not about an email or mapping a drive or conversion to base64. That is all solved. I was hoping that someone could point me in the direction of the best technology to use to get to the IFS from Visual Basic.
                              If you follow the steps to mapping the drive like I showed above, then all your VB program has to do is:

                              Code:
                              NewFilePath= "i:/SomeDirectoryOnTheIFS/ImageName.tif"            
                              OldFile = "c:/DirectoryOnLocalPcWhereTheImageCurrentlyResides/ImageName.tif"
                              FileCopy OldFile, NewFile

                              If you map a drive to the iSeries on the PC, then the IFS is available to VB or any other program on the PC without the use of any other technology.
                              Last edited by MichaelCatalani; May 26, 2011, 10:00 AM.
                              Michael Catalani
                              IS Director, eCommerce & Web Development
                              Acceptance Insurance Corporation
                              www.AcceptanceInsurance.com
                              www.ProvatoSys.com

                              Comment

                              Working...
                              X