• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Download capability
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Download capability


  • Subject: Download capability
  • From: Erwin <email@hidden>
  • Date: Sun, 31 Oct 2004 16:08:17 +0100

I am testing the download capability ... it runs well, the downloaded picture is displayed into the navigator
but I would like to give the user the possibility to store the downloaded file into his own file system....
wwhat should I modify ?

here is teh code I am using ::
.....
if (filepath != null && filepath.length() > 0) {
URL file = null;
NSData fileContents = null;
String fileName = NSPathUtilities.lastPathComponent(filepath );
String mimeType = WXFileUtilities.mimeTypeFromPath(filepath);
try {
file = new URL("file", null, filepath);
fileContents = new NSData(file);
aResponse.setContentEncoding("UTF8");
aResponse.setHeader(mimeType, "content-type");
aResponse.setHeader("filename=" + fileName,"Content-Disposition");
aResponse.setContent(fileContents);
aResponse.setStatus(WOMessage.HTTP_STATUS_OK);
} catch (Exception e) {
NSLog.err.appendln("Error downloading file: " + e);
aResponse = new WOResponse();
aResponse.appendContentString("Error downloading file: " + e);
}
}
return aResponse;
....
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Testing whether an editing context is locked
  • Next by Date: Re: Testing whether an editing context is locked
  • Previous by thread: Re: Testing whether an editing context is locked
  • Next by thread: RuleModeler Update (0.5)
  • Index(es):
    • Date
    • Thread