MSPGetUploadFile[]
returns the representation of an uploaded HTTP file.


MSPGetUploadFile
MSPGetUploadFile[]
returns the representation of an uploaded HTTP file.
Details
- This provides a useful utility function for uploading files from the client to the server using multipart/form-data submissions.
- The contents of the file are saved in a new file on the server and the name of this file is returned.
- The file on the server will eventually be cleared in a way similar to the clearing of image and other temporary files.
- The result of MSPGetUploadFile is a list of rules that show the file name on the server, the original file name on the client and the content type:
-
"FileName" the name of the file on the server "OriginalFileName" the original name of the file before upload "ContentType" the content type of the file - Note that parameters that are present in the HTTP headers become available as $$ variables after the use of MSPGetUploadFile or MSPGetUploadFileList. After this, they can be used in the normal way.
- There is a maximum size for a file that can be uploaded by MSPGetUploadFile; by default, this is 4 MB. This is set by the configuration parameter FileUploadSizeLimit.
- The following exception can be thrown by MSPGetUploadFile:
-
MSPException["FileUploadError"] if an error is encountered while retrieving the upload file
Examples
Basic Examples (1)
The function cannot be demonstrated since it must be part of an actual HTTP transaction with appropriate information sent from the client. This example simulates the way that the function can be used with Mathematica programming:
The file name can be extracted with the typical Mathematica commands used for working with rules:
Text
Wolfram Research (1996), MSPGetUploadFile, Wolfram Language function, https://reference.wolfram.com/language/WolframWebEngine/ref/MSPGetUploadFile.html.
CMS
Wolfram Language. 1996. "MSPGetUploadFile." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/WolframWebEngine/ref/MSPGetUploadFile.html.
APA
Wolfram Language. (1996). MSPGetUploadFile. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/WolframWebEngine/ref/MSPGetUploadFile.html
BibTeX
@misc{reference.wolfram_2025_mspgetuploadfile, author="Wolfram Research", title="{MSPGetUploadFile}", year="1996", howpublished="\url{https://reference.wolfram.com/language/WolframWebEngine/ref/MSPGetUploadFile.html}", note=[Accessed: 25-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_mspgetuploadfile, organization={Wolfram Research}, title={MSPGetUploadFile}, year={1996}, url={https://reference.wolfram.com/language/WolframWebEngine/ref/MSPGetUploadFile.html}, note=[Accessed: 25-August-2025]}