How to Store a non Xml doc into Tamino from a Remote Host.

Greetings list,
I have solve this problem,and as a contribution for you all. Here’s how I did it(With JSP):

1-The problem resides on performing a remote upload from a client to the server, an then the server is the one who store the uploaded file.

2-Coding this can be a little bit tricky and time consuming,so I recomend you to visit the page http://www.jspsmart.com , and you can download a bean , free of charge, that can perform clients uploads, with the additional file info, like size, content type etc.Which at the eyes of the user is huge!
2.1-Create a temp directory on the server for uploading.

3-Then, the html form for file input must declare:
enctype=“multipart/form-data”.
4-On the jsp page that will interact with tamino,
4.1-import the clases for tamino and the bean:
<%@ page language=“java” import=“com.softwareag.tamino.api.dom.,com.jspsmart.upload.,org.w3c.dom.,java.util.,java.io.,com.docuverse.dom.,com.jclark.xml.sax.Driver” %>
<jsp:useBean id=“mySmartUpload” scope=“page” class=“com.jspsmart.upload.SmartUpload” />
4.2-Select the file or files which you whant to store in Tamino:
mySmartUpload.initialize(pageContext);
mySmartUpload.setTotalMaxFileSize(10000000);
mySmartUpload.upload();
for (int i=0;i<mySmartUpload.getFiles().getCount();i++){
com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(i);
if (!myFile.isMissing()) {
myFile.saveAs(“c:\upload\” + myFile.getFileName(), mySmartUpload.SAVE_PHYSICAL);}
This will save the file on a temp directory on the server called upload.
5-Tell Tamino to download the files within that directory, and you are set!
String path=new String(“C:/upload/”);
String file = path+archname;
TaminoResult tr = nonX.setNonXML("/sailing/images/" + archname, file, contenttype );
where archname and contenttype is provided by the imported bean.

Hope this can help all of you!

Regards,

Jonathan Saul Torres Diaz
Consultant
mail me at:jtorres@aps.com.ve
jtorres@xml.com.ve