[Building Sakai] Returning binary data (pdf) from Entity Provider?
Curtis Van-Osch
curtis.van-osch at hec.ca
Thu Nov 8 12:25:51 PST 2012
Hi,
I'm trying to have a custom action in my EntityProvider send a PDF back
to the browser. I've figured out how to get the pdf from
ContentHostingService, but I can't seem to get any byte data out to the
client (even a single character or simple string) through an ActionReturn.
You can see the test code I've set up in the attached text file.
Whenever I return an ActionReturn with a ByteArrayOuputStream, the
client gets a response with 0 Content-Length (as seen in firebug) but a
success code (200).
If I write the data to the OutputStream parameter that is available to
the custom action it gets sent to the browser, but in that case I cannot
see how to set the content-type to "application/pdf".
Has anyone tried to do anything similar? I'd appreciate any input.
--
*Curtis van Osch*
Analyste en informatique
Service de gestion des technologies de l'information
HEC Montréal
514-340-6000 poste 2029
curtis.van-osch at hec.ca <mailto:curtis.van-osch at hec.ca>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20121108/733a5fea/attachment.html
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: customActionByte.txt
Url: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20121108/733a5fea/attachment.txt
More information about the sakai-dev
mailing list