Josh,

thanks a lot, it works beautifully!

-karsten

josh_feinstein wrote:
> 
> I have to correct myself - "content-disposition" is not an environmental
> variable.  Nevertheless, despite my irresponsible use of syntax, I believe my
> suggestion may still be helpful.
> 
> Karsten:
> 
> I had the same problem using pdf files a little while back. To solve the
> problem, in the header, I manipulated the environmental variable
> "content-disposition", and achieved the desired result. (Credit due to Kai
> Wong who told me to use content-disposition).
> 
> Here is an example in objc;
> 
> [response setContent:theData];
>     [response setHeader:@"application/pdf" forKey:@"content-type"];
>     [response setHeader:@"attachment;filename=yourFile.pdf",]
> forKey:@"content-disposition"]; }
> 
> I hope this is helpful,
> Joshua
> 
> Karsten D. Wolf wrote:
> 
> > Hi fellow WO-mavens,
> >
> > I have a WOComponent for showing the content of a file out of a database
> > in a WOApp,
> > the code goes like this
> >
> > public class DataShowFile extends WOComponent    {
> >
> > // some vars
> >
> > public void appendToResponse(WOResponse aResponse, WOContext aContext)   8
> >         // some checking etc.
> > aResponse.setContent(new NSData());
> > aResponse.setHeader(mimeType,"content-type");
> > }
> > }
> >
> > OK, now if I have another WOComponent showing all the "files" in my
> > database, and I put a WOHyperlink with an action to return the
> > DataShowFile component to each of the "files" names, everything works
> > fine (the browser of the user downloads the file and opens it in the
> > right helper app), but the name of the new document is something like
> > 16.3.9.0.3.3
> >
> > This is a bit irritating for some users. Is there any way to fool WO
> > into giving back names to the browser like "SomeText.doc" instead of
> > 16.3.9.0.3.3? Is there some header I could set?
> >
> > puzzled,
> >
> > -karsten

Reply via email to