wwRequest::GetMultipartFormVar

Retrieves a multipart form variable from the request buffer. Multipart form variables are submitted on the client side by specifiying an encoding type of "multipart/form-data".

Multipart forms are inherently more efficient especially for large form submissions since the data is not encoded. Multi-part forms are also used for HTTP file uploads.

To create a multipart form add the following enctype attribute to your form:



o.GetMultipartFormVar(lcKey)

String of the value retrieved. A null string if the var doesn't exist.

Parameters

lcKey
The multipart form variable to retrieve

Example

lcFileBuffer = Request.GetMultiPartFile("File",@lcFileName) lcNotes = Request.GetMultipartFormVar("txtFileNotes") lcFileName = SYS(2023)+""+lcFileName

IF LEN(lcFileBuffer) > 5000000 THIS.StandardPage("File upload refused",; "Files over 500k are not allowed for this sample...
"+; "File: " + lcFilename) RETURN ENDIF

  • ** Now dump the file to disk STRTOFILE(lcFilebuffer,lcFileName)

THIS.StandardPage("Thank you for your file upload",; "File Uploaded: " + lcFileName + ; " (" + TRANSFORM(FileSize(lcFileName),"9,999,999") + " bytes)

"+ ; "Notes:
"+ CRLF + lcNotes )

See also

Class wwRequest
wwRequest::GetMultipartFile
wwRequest::Form

© West Wind Technologies, 2025 • Updated: 2025-03-12
Comment or report problem with topic