JSPSMARTUPLOAD : DOCUMENTATION |
File Object Last modified: March 1st, 2000 © 2000 Advantys. All rights reserved. |
The getBinaryData property contains the byte corresponding to the table index containing the transmitted data.
Syntax
.getBinaryData (index)Return Value
Returns a byte value.
Parameter
index is an index of the byte's array.Example
<%
for (i=0;i<myUpload.getFiles().getFile(0).getSize();i++) {
out.println(myUpLoad.getFiles().getFile(0).getBinaryData(i));
}
%>
The fileToField method saves file in a field of a specified DataBase.
Syntax
.fileToField(rs,ColumnName)Parameters
rs is the RecordSet.
ColumnName is the field's name of the RecordSet which will contain the file.Example
<%
myUpload.getFiles().getFile(0).fileToField(myRS,"FILE");
%>
The getContentDisp property contains the content-disposition of field Data.
Syntax
.getContentDispReturn Value
Returns a String value.Example
<%
Content-disposition
out.println("=" + myUpLoad.getFiles().getFile(0).getContentDisp());
%>
The getContentString property contains contents of the file.
Syntax
.getContentStringReturn Value
Returns a String value.Example
<%
out.println("Contents=" + myUpLoad.getFiles().getFile(0).getContentString());
%>
The getContentType property contains the Content-Type of field Data.
Syntax
.getContentTypeReturn Value
Returns a String value.Example
<%
Content-Type
out.println("=" + myUpLoad.getFiles().getFile(0).getContentType());
%>
The getFieldName property contains the value of the attribute NAME of the <INPUT TYPE='file'> Tag.
Syntax
.getFieldNameReturn Value
Returns a String value.Example
<%
out.println("Name=" + myUpLoad.getFiles().getFile(0).getFieldName());
%>
The getFileExt property contains the extension of the file.
Syntax
.getFileExtReturn Value
Returns a String value.Example
<%
out.println("Extension=" + myUpLoad.getFiles().getFile(0).getFileExt());
%>
The getFileName property contains the name of the file.
Syntax
.getFileNameReturn Value
Returns a String value.Example
<%
out.println("FileName=" + myUpLoad.getFiles().getFile(0).getFileName());
%>
The getFilePathName property contains the full path of the file.
Syntax
.getFilePathNameReturn Value
Returns a String value.Example
<%
out.println("Path=" + myUpLoad.getFiles().getFile(0).getFilePathName());
%>
The getSize property contains the file's size.
Syntax
.getSizeReturn Value
Returns a int value.Example
<%
Size
out.println("=" + myUpLoad.getFiles().getFile(0).getSize());
%>
The getSubTypeMIME property contains the sub-Type of the file.
Syntax
.getSubTypeMIMEReturn Value
Returns a String value.Example
<%
out.println("MIME Sub-Type=" + myUpLoad.getFiles().getFile(0).getSubTypeMIME());
%>
The getTypeMIME property contains the Type of the file (application, audio, image,multipart, text, video, ... ).
Syntax
.getTypeMIMEReturn Value
Returns a String value.Example
<%
MIME
out.println("Type=" + myUpLoad.getFiles().getFile(0).getTypeMIME());
%>
The isMissing property returns a boolean which indicates if user has not specified a file.
Syntax
.isMissingReturn Value
Returns a Boolean value.Example
<%
if (myUpLoad.getFiles().getFile(0).isMissing()) {
out.println("There is no specified file.");
}
%>
The saveAs method saves file in the specified directory. This method always overwrites existing files.
Syntax
.saveAs (FilePathName [, Option])Parameter
FilePathName is the destination directory with the file's name. It could be a physical or a virtual path. If there is only the file's name then this one will be saved on the root directory of the web server.
Option is optional. This parameter allow you to force the type of the path.
SAVE_AUTO : If the path is not a virtual path, the Save method consider this path as a physical path (by default).
SAVE_VIRTUAL : If the path is not a virtual path, the Save method return an error.
SAVE_PHYSICAL : If the path is not a physical path, the Save method return an error.Examples
<%
myUpload.getFiles().getFile(0).saveas "c:\\"+myUpload.getFiles().getFile(0).getFilename();
myUpload.getFiles().getFile(1).saveas "/docs/"+myUpload.getFiles.getFile(1).getFilename();
myUpload.getFiles().getFile(2).saveas "myFile.txt";
%>
© 2000 Advantys. All rights reserved.