O ' r a n g e  

web soft team

Extra uploader >> How to install and use:

NEWS:
 10:9:01
New site design is presented.
  3:11:01
New Forum is opened. You can ask the  questions  about our products .
     

1.You must download and unzip fupload.zip first. 

To try the examples copy exupload folder into your server's webapp directory.  Try http://yourserver:8080/exupload/

2. To use extra uploader into yor jsp page do following:

  1. copy com directory from exupload/web-inf/classes into yourapp/web-inf/classes/ directory
  2. in your page insert the following code for initializing uploader,setting filter  and upload

    <jsp:useBean id='reader' scope='page' class='com.orange.fupload.MultiPartRequest' type="com.orange.fupload.MultiPartRequest" />
    <%
    reader.setMaxLength(80000000);//set max file length
    String[] fltr={"htm","txt","pdf","zip"};//these files to upload
    reader.setFilterToUpload(fltr);//set filter
    ServletContext scon=pageContext.getServletContext();
    String path = scon.getRealPath("\\upload");
    reader.setTempDirectory(path);//upload into upload //subfolder
    reader.prepareProcess(request);initializing
    reader.processRequest();//upload all
    %>

  3. Accessing uploaded files and fields: use following functions:
    1. FIELDS:reader.getField("fieldname");get field value by field name
    2. FILES:reader.getFileName("fileformname"); reader.getFileExt("fileformname"); reader.getFileContDisp("fileformname");   reader.getFileMimeType("fileformname"); reader.getFileLength("fileformname"); reader.isFileSaved("fileformname"); reader.isFileEmpty("fileformname"); reader.isFileSkipped("fileformname"); reader.getInputStream("fileformname");
    3. Accessing files and fields by use Enumeration;  use following code:  FILES: 

    Enumeration  efl =reader.getFileFields();
    while(efl.hasMoreElements())
    {
    String fn=(String)efl.nextElement();
    String fv=reader.getFileName(fn);
    String xt=reader.getFileExt(fn);
    String em;
    String sc;
    if(reader.isFileEmpty(fn))em="file not delivered"; else em="File delivered";
    if(reader.isFileSkipped(fn))sc="file Skipped"; else sc="File loaded";

    %>
    File name=<%=fn%>| File name =<%=fv%>Status:<%=em%>|<%=sc%><p>
    <%
    }

FIELDS:

  1. Enumeration efld=reader.getFieldNames();
    while(efld.hasMoreElements())
    {
    String fn=(String)efld.nextElement();
    String fv=reader.getField(fn);
    %>
    Field name=<%=fn%>| Field Value=<%=fv%><p>
    <%
    }
  1. Step-by Step Uploading:Use following codeafter initializing  (see above code for initializing but without reader.processRequest())

while(reader.nextHeader()){
if(reader.isFile()){
String ext=reader.getCurrentExtension();
String em;
if(reader.isCurrentEmpty())em="File Not Delivered";else em="File delivered";
%>
File Name=<%=reader.getCurrentFileName()%>File extension=<%=ext%> File Status=<%=em%>MimeType <%=reader.getCurrentMimeType()%>
ContentDisp=<%=reader.getCurrentContDisp()%><p>
<%
reader.saveNextPart();

}else{
reader.nextPart();
}
}

while s-b-s uploading you can use following functions:

boolean reader.nextHeader() - uploading next header:

boolean reader.isFile(); - is next part file or field

String reader.getCurrentExtension(); - current fileExtension

String reader.getCurrentFileName();- current file Name

String reader.getCurrentContDisp();-current content disposition;

String reader.getCurrentMimeType() - current mime type

 

 

Copyright O'range 2001.

Other usefull tools you can find at

ScriptSearch.com

Hosted by uCoz