I have followed serveral examples but still have an issue downloading a file
using an input stream. In IE7 when I try the download with text/plain
context type, the text is rendered in the html page. When I change the
contentType a file dialog folder pops up with open/open folder/ cancel no
save button.

There is also a popup window that says Internet Explorer cannot download
extractAccounting.action from localhost.  Internet Explorer was not able to
open this Internet site. The requested site is either unavailable or cannot
be found. Please try again later.

On firefox there is no file save dialog, just the text displayed.

I want to be able to generate .csv files and have the user be able to save
them on their pc.

The struts.xml entry is.

        <action name="extractAccounting"
class="com.merrick.bestmatch.presentation.action.billing.AccountingLink"
                method="extractAccounting">
            <result name="success" type="stream">
            document.pdf
            inputStream
            filename="document.pdf"
            1024
            </result>
        </action>


The action class is:


public class AccountingLink extends BestMatchActionSupport implements
PropertiesAware
{

    private InputStream inputStream;

//----------------------------------------------------------------------------------------------------
public String extractAccounting()
{
    

    String text = "Converting String to InputStream Example";

    try
    {
        inputStream = new ByteArrayInputStream(text.getBytes("UTF-8"));
    }
    catch (UnsupportedEncodingException e)
    {
        e.printStackTrace();
    }


return SUCCESS;

}
//----------------------------------------------------------------------------------------------------
    public InputStream getInputStream()
      {
        return inputStream;
      }

}


Any help with figuring out what the problem is and a solution is
appreciated.

---John Putnam

-- 
View this message in context: 
http://www.nabble.com/Problem-with-file-download.-tp22232119p22232119.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to