11.07.2015 Views

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

126 webMathematica User GuideCertain HTTP clients can use the content type to launch a helper application. However, someclients need a filename to be associated with the request. For this purpose, MSPReturn takes athird argument that sets the filename in an HTTP header. An example follows.If[ format === Notebook,MSPReturn[ data, "application/mathematica","notebook.nb"]];However, for some HTTP clients (for example Internet Explorer) this has the undesirable effectof causing the client to display two Open or Save dialog boxes. Most clients work much betterif the request for the script that contains the MSPReturn uses the filename with an appropriateextension. Since the extension for webMathematica requests has to end in .jsp, this is notpossible. An alternative is to generate a URL that has the correct extension; this functionality isprovided by MSPURLStore.MSPReturn is useful when the commands are embedded inside an existing page and you justwant to terminate processing the page and return the result. It is simpler to use the directreturn technique, so this would be preferred if it is possible.MSPURLStoreMSPURLStore uses the mechanism that webMathematica provides for storing images generatedby commands such as MSPShow. It actually stores its argument on the server and returns a URLthat references the argument.In[1]:=In[2]:=Needs@"MSP`"Dm = ExportString@Graphics@Line@ 880, 0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!