JSPSMARTUPLOAD : DOCUMENTATION
Requirements
Last modified: June 1st, 2000
© 2000 Advantys. All rights reserved.

Initialization

The jspSmartUpload need information about environment of your JavaServer Pages which called it. You need to pass the configuration information about the server. The init() and service() method are deprecated.

ATTENTION : When the component is called from a servlet you must use the initialize(config,request,response) method.

Example :

<%@ page language="java" import="com.jspsmart.upload.*"%>
<jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
<%
   // Variables
   int count=0;

   // Initialization with jspSmartUpload v2.1
   mySmartUpload.initialize(pageContext);


   // Initialization with jspSmartUpload v2.0 (deprecated)
   mySmartUpload.init(config);
   mySmartUpload.service(request,response);
%>

Form

The ENCTYPE="multipart/form-data" attribute in the FORM tag is required.

Example :

<FORM ENCTYPE="multipart/form-data" ACTION="/jspSmartUpload/upload.jsp">
<INPUT TYPE="FILE" NAME="MYFILE">
<INPUT TYPE="SUBMIT">
</FORM>

upload method

The upload method must be called before any other methods of the jspSmartUpload object.

Example :

<%

' not possible
' ********
' out.println(myUpload.getRequest().getParameter("myParameter") + "<br>");
' myUpload.upload();

' Possible
' ******
myUpload.upload();
out.println(myUpload.getRequest().getParameter("myParameter") + "<br>");
%>

upload and uploadInFile methods

The upload and uploadInFile methods cannot be used in the same JSP.


downloadFile and downloadField methods

The JSP script which execute a download should not have HTML tags (Carefull with carrier return).

Example :

DownloadFile
<%@ page language="java" import="com.jspsmart.upload.*"%><jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" /><%

   // Initialization with jspSmartUpload v2.1
   mySmartUpload.initialize(pageContext);

  // Download
  mySmartUpload.downloadFile("/upload/sample.zip");
%>


© 2000 Advantys. All rights reserved.