## Image upload and scale

Image description:
Image upload:
Scaled Image:
" end-display ?>

------------------------------------------------------------------------------ GET-VALUES SECTION. *>------------------------------------------------------------------------------ call "HTM2COB-POST" using "filedesc", filedesc end-call call "HTM2COB-SPEC-CHARS" using filedesc, htm-filedesc end-call call "HTM2COB-POST" using "upload", upload end-call call "HTM2COB-SPEC-CHARS" using upload, htm-upload end-call EXIT SECTION . *>------------------------------------------------------------------------------ CREATE-OUT-NAME SECTION. *>------------------------------------------------------------------------------ MOVE FUNCTION SUBSTITUTE-CASE(htm-upload, ".png", ".jpg") TO WS-OUT-NAME EXIT SECTION . *>------------------------------------------------------------------------------ IMGSCALE-AND-COPY SECTION. *>------------------------------------------------------------------------------ MOVE SPACES TO WS-IMG-IN STRING HTM2COB-UPLOAD-FILE-PATH DELIMITED BY SPACE trim(htm-upload) X"00" DELIMITED BY SIZE INTO WS-IMG-IN END-STRING SET V-PNG OF WS-IMG-IN-TYPE TO TRUE *> scale width MOVE 200 TO WS-WIDTH-OUT *> convert in JPG MOVE SPACES TO WS-IMG-OUT STRING WS-HTDOCS-PATH DELIMITED BY SPACE trim(WS-OUT-NAME) X"00" DELIMITED BY SIZE INTO WS-IMG-OUT END-STRING SET V-JPG OF WS-IMG-OUT-TYPE TO TRUE PERFORM CONVERT-AND-SCALE-IMG EXIT SECTION . *>------------------------------------------------------------------------------ CONVERT-AND-SCALE-IMG SECTION. *>------------------------------------------------------------------------------ CALL "imgscale" USING BY REFERENCE WS-IMG-IN , BY REFERENCE WS-IMG-IN-TYPE , BY REFERENCE WS-IMG-OUT , BY REFERENCE WS-IMG-OUT-TYPE , BY REFERENCE WS-WIDTH-OUT RETURNING WS-RETVAL END-CALL EXIT SECTION . ?>