You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Steve Aument <s....@pentasafe.com> on 2000/11/09 20:10:38 UTC

RE: sending zip file to browser

    response.setHeader("Content-Disposition","inline; filename=app.zip");

    /stephen

> -----Original Message-----
> From:	Naveed Khan [SMTP:naveedaman@hotmail.com]
> Sent:	Thursday, November 09, 2000 5:07 PM
> To:	struts-user@jakarta.apache.org
> Subject:	sending zip file to browser
> 
> Guys:
> 
> I m trying to send a zip file from an action class back to browser.. a 
> portion of code i m using is below :
> 
> .........
> ..........
> zipFiles( pathPrefix , filesArr , outFileName );
> response.setContentType( "application" );
> sendZipFile( outFileName , response.getOutputStream() );
> .........
> ..........
> 
> the code works fine but the only problem is taht when user tries to save
> the 
> file the default file name offered is "download.do" ?? i want it to be
> some 
> thing like "app.zip" .. "download.do" is the value of action "attribute"
> of 
> the form which sends download request to server..
> 
> any idea how i can show user "app.zip" instead of "download.do" ??
> 
> is there any way to change action from download.do to say 'download.zip'
> and 
> still get to the action class ??
> 
> thanks ..
> 
> 
> naveed
> 
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> 
> Share information about yourself, create your own public profile at 
> http://profiles.msn.com.