Question

I'm experiencing a problem while trying to develop a webapp with ZK 7, Tomcat 7 on Windows XP.

The problem is on the file download function I wrote:

        String path = Executions.getCurrent().getDesktop().getWebApp()+"/28.txt";
    try {
        Filedownload.save(path,null);
    } catch (Exception e) {
        Messagebox.show("Errore recupero risorsa "+path);
    }

PATH: C:\openxava-4.5.1\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp4\wtpwebapps\ProjectName\

I tried to print the path content and put it on Windows Explorer and obviously I get to the file as the file is physically in that path.

The problem is that I get the FileNotFoundException, like the WebServer os Framework doesn't /can't find it.

Any idea because the function throws the FileNotFound exception? How to reach that file and get it to download?

Thanks

Was it helpful?

Solution

the solution is this:

    String percorso = "/28.txt
    try {
        Filedownload.save(percorso,null);
    } catch (Exception e) {
        Messagebox.show("Errore recupero risorsa "+percorso);
    }

but the problem is probably in the upload you shuld use this path for the upload : String path = Executions.getCurrent().getDesktop().getWebApp().getRealPath("/")+"folder/";

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top