MSPGetUploadFileList


receive information on several HTTP upload files

DetailsDetails

  • This provides a useful utility function for uploading files from the client to the server using multipart/form-data submissions.
  • The contents of files are saved in new files on the server.
  • Files on the server will eventually be cleared in a way similar to the clearing of image and other temporary files.
  • The result of MSPGetUploadFileList is a list of lists of rules that show filenames on the server, original filenames on the client, and content types.
  • "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 MSPGetUploadFileList; by default this is 4MB. 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

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

The function cannot be demonstrated since it must really be part of an actual HTTP transaction with appropriate information sent from the client. This example just simulates the way that the function can be used with Mathematica programming.

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=