I have a problem with my application. I have a functionality that downloads a template in Word from the server, and opens it with the word, but without physically downloading it to the PC. In theory, I would have to save it in a pre-established route on the server, but when I save it, it asks for a place to save it and I can not save it on the server. Formerly if that could be done, but making several changes to the rest of the application can no longer be done. Any ideas on how to do it?
The application is a web page with Java / JSP. Greetings
PS: Like this is not the right place, but I did not know where to put the question.
public String getTemplatePath(DbCnt cnt, CTTemplate ctTemplate) throws ISPACException {
String sName = "";
try {
int e = ctTemplate.getTemplate();
Date dateTemplate = ctTemplate.getDate();
String mimetype = ctTemplate.getMimetype();
String ext = MimetypeMapping.getExtension(mimetype);
sName = Integer.toString(e) + "." + ext;
OrganizationUserInfo info = OrganizationUser.getOrganizationUserInfo();
if(info != null) {
String file = info.getOrganizationId();
sName = file + "_" + sName;
}
File file1 = new File(this.mFileDirContext.getDocBase(), sName);
if(file1.exists()) {
FileResourceAttributes attributes = (FileResourceAttributes)this.mFileDirContext.getAttributes(sName);
Date dateFile = attributes.getLastModifiedDate();
if(dateTemplate.after(dateFile)) {
this.bind(cnt, sName, e);
}
} else {
this.bind(cnt, sName, e);
}
} catch (Exception arg11) {
throw new ISPACException(arg11);
}
return this.mFileDirContext.getDocBase() + "/" + sName;
}
Basically what I understand what it does here is that it generates the document, with the data of the document taken from the database. Then the word is opened, but physically it is not stored in the PC, it is as if it were a temporary, not physically downloaded.