Uploading ZIP files

Ernesto Pin <[email protected]>
Newsgroups gmane.comp.jakarta.slide.devel
Message-ID <32905000.1157398145118.JavaMail.tomcat@fe-ps02>
Hi. I'm trying to upload zip files to slide with WebdavResource.
putMethod(String, InputStream). The files are being successfully 
uploaded, but if you get them, they are empty, or they have errors 
(such as "file unexpectedly terminated"). ¿Any help?. Below is my 
code....

Ernesto

public String altaPaquete(String psNombre, FileInputStream poFile) 
throws 
	TPaqueteNoSubidoException {
    if(poFile != null){
        String lsServerRoot = getServerRoot() + ":" + getServerPort() 
+ "/";
        HttpURL loURL = new HttpURL(getServerRoot()+ ":" + 
getServerPort());
        boolean lbExito = false;
        try {
            loURL.setUserInfo(getUserName(),getUserPassword());
            WebdavResource loRemoteFile = new WebdavResource(loURL);
            lbExito = loRemoteFile.putMethod(getServerPath() + 
psNombre, poFile);
            loRemoteFile.close();
        } catch (MalformedURLException e) {
            throw new TPaqueteNoSubidoException("URL mal formada", e);
        } catch (HttpException e) {
            throw new TPaqueteNoSubidoException(e);
        } catch (IOException e) {
            throw new TPaqueteNoSubidoException(e);
        }
		    
        if(lbExito){
            return lsServerRoot + getServerPath() + psNombre;
        } else {
            throw new TPaqueteNoSubidoException("No se pudo guardar el 
archivo");
        }
    } else {
        throw new TPaqueteNoSubidoException("No se puede leer el 
archivo");
    }
}

And Invocation is like this.....

File coFile = new File("aZipFile.zip");
FileInputStream loStream = new FileInputStream(coFile);
String lsURL = loServer.altaPaquete(coFile.getName(), loStream);

I must use Stream version of the method because this is going to be 
invoked remotely (web browser)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.