Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FileDownload



Hello Kranthi,

supposed you have an object "data" with data loaded from the desired server file
you can build a WOResponse object and return it as result of a given direct
action.

        r.setHeader(data.getMimetype(),"content-type");
        r.setHeader("attachment;
filename=\""+data.getFilename()+"\"","content-disposition");
  if(data.stringData != null) // data is in a string
   r.appendContentString(data.stringData.toString());
  else // data is in an NSData instance
         r.appendContentData(data.getRawData());

Regards,

Richard
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.