$! CGIUTL.C Usage Example 2 $! Submitted by example form WASD_ROOT:[SRC.MISC]CGIUTL_EXAMPLE2.HTML $! 28-DEC-2008 MGD bugfix; CGI response for DEBUG=1 $! 19-APR-2000 MGD initial (demonstrate file upload) $! $ Debug = 0 $ if Debug $ then $ write sys$output "Content-type: text/plain" $ write sys$output "" $ set verify $ endif $! $ say = "write sys$output" $ CGIutl = "$cgi-bin:[000000]cgiutl" $! Locate a unique scratch file somewhere we know the server account can write. $ FileName = "wasd_scratch:CGIUTL" + f$cvtime(,,"year") + - f$cvtime(,,"month") + f$cvtime(,,"day") + f$cvtime(,,"hour") + - f$cvtime(,,"minute") + f$cvtime(,,"second") + - f$cvtime(,,"hundredth") + ".TXT" $! $ if Debug then show symbol * $! Use the CGIUTL utility to process the POSTed body contents. $ CGIutl /multipart /field=file /symbols /output='FileName' $ if Debug then show symbol * $! $ if f$search(FileName) .eqs. "" $ then $ say "Content-Type: text/html" $ say "" $ say "ERROR generating upload file!" $ exit $ endif $! $ set noon $ on error then goto CleanUp $! $ say "Content-Type: text/plain" $ say "" $ say "This is the created file:" $ directory/full 'FileName' $ say "" $ say "And here are the specific symbols created from the request:" $ say "" $ show symbol cgiutl%* $ say "" $! $ CleanUp: $ if f$trnlnm("FileHandle","LNM$PROCESS") .nes. "" then close FileHandle $ if f$search(FileName) .nes. "" then delete /nolog /noconfirm 'FileName';*