      SUBROUTINE PLW.DECODE.MULTIPART(SRC)
*PIC-LAN
*
*ALL
*PC
*N
*
*
*
*
******************************************************************************
******************************************************************************
***                                                                        ***
*** (C) Copyright 1990-2005 Doug Dumitru, All Rights Reserved.             ***
***                                                                        ***
*** This program is licensed under the terms of the GNU General Public     ***
*** License, version 2.0 with attached notices.                            ***
***                                                                        ***
*** The full text can be found in the LICENSE.TXT file in the              ***
*** PLIP.BP database file (the /usr/qmweb/PLIP.BP/PLIP.BP directory).      ***
***                                                                        ***
******************************************************************************
******************************************************************************
*
      INCLUDE SYS.TYPE.INCLUDE
*
      INCLUDE PL.COMMON
      INCLUDE PL.COMMON.DEFS
      INCLUDE PL.DEFS
      INCLUDE PLIP.COMMON
      INCLUDE PLW.COMMON
*
      T = INDEX(SRC,CRLF,1)
      IF T <= 1 THEN RETURN
*
      S.STR = SRC[1,T-1]
*
      FOR I = 1 TO 999
         T0 = INDEX(SRC,S.STR : CRLF,I)
         T1 = INDEX(SRC,S.STR,I+1)
         IF T0 < 1 OR T1 < 1 THEN RETURN
         T0 = T0 + LEN(S.STR) + 2
         SS = SRC[T0,T1-T0-2]
         GOSUB 100
      NEXT I
*
      RETURN
*
100   REM Process SS
*
      T2 = INDEX(SS,CRLF:CRLF,1)
      IF T2 < 2 THEN RETURN
*
      S.HDR = SS[1,T2-1]
      S.HDR = PL_CRLFTOAM(S.HDR)
      S.DTA = SS[T2+4,BIG.STR]
*
      WW = FIELD(S.HDR<1>,':',1)
      WW = OCONV(TRIM(WW),'MCU')
      IF WW <> 'CONTENT-DISPOSITION' THEN RETURN
*
      L = OCONV(S.HDR<1>,'G1:999')
*
      WW = PL_REPL(L,';',AM)
      FOR J = 1 TO DCOUNT(WW,AM)
         WW<J> = TRIM(WW<J>)
         IF J <= 2 THEN
            WW<J> = OCONV(WW<J>,'MCU')
         END
      NEXT J
*
      IF WW<1> <> 'FORM-DATA' THEN RETURN
      IF FIELD(WW<2>,'=',1) <> 'NAME' THEN RETURN
*
      FIELD.NAME = FIELD(FIELD(WW<2>,'=',2),'"',2)
*
      FILE.NO = 1
      IF OCONV(FIELD(WW<3>,'=',1),'MCU') = 'FILENAME' THEN
         FILE.NAME = FIELD(FIELD(WW<3>,'=',2),'"',2)
         PL_PUTVAR FIELD.NAME : ' ' : FILE.NAME IN '$' : FILE.NO : '_NAME' ELSE NULL
         PL_PUTVAR S.DTA IN '$' : FILE.NO : '_DATA' ELSE NULL
         FILE.NO = FILE.NO + 1
      END ELSE
         PL_PUTVAR S.DTA IN FIELD.NAME ELSE NULL
      END
*
      RETURN
   END
