ASPSMARTUPLOAD : DOCUMENTATION
File Object
Last modified: August 1st, 1999 
2002 Advantys. All rights reserved.

Name

The Name property contains the value of the attribute NAME of the  <INPUT TYPE='file'> Tag.

Syntax
.Name

Return Value
Returns a String value.

Example

<%
Response.Write("Name=" & MyUpLoad.Files.Item(2).Name)
%>

FileName

The FileName property contains the name of the file.

Syntax
.FileName

Return Value
Returns a String value.

Example

<%
Response.Write("FileName=" & MyUpLoad.Files.Item(2).FileName)
%>

FileExt

The FileExt property contains the extension of the file.

Syntax
.FileExt

Return Value
Returns a String value.

Example

<%
Response.Write("Extension=" & MyUpLoad.Files.Item(2).FileExt)
%>

FilePathName

The FilePathName property contains the full path of the file.

Syntax
.FilePathName

Return Value
Returns a String value.

Example

<%
Response.Write("Path=" & MyUpLoad.Files.Item(2).FilePathName)
%>

ContentType

The ContentType property contains the Content-Type of field Data.

Syntax
.ContentType

Return Value
Returns a String value.

Example

<%
Response.Write("
Content-Type=" & MyUpLoad.Files.Item(2).ContentType)
%>

ContentDisp

The ContentDisp property contains the content-disposition of field Data.

Syntax
.ContentDisp

Return Value
Returns a String value.

Example

<%
Response.Write("
Content-disposition=" & MyUpLoad.Files.Item(2).ContentDisp)
%>

Size

The Size property contains the file's size.

Syntax
.Size

Return Value
Returns a Long value.

Example

<%
Response.Write("
Size=" & MyUpLoad.Files.Item(2).Size)
%>

ContentString

The ContentString property contains contents of the file.

Syntax
.ContentString

Return Value
Returns a String value.

Example

<%
Response.Write("Contents=" & MyUpLoad.Files.Item(2).ContentString)
%>

TypeMIME

The TypeMIME property contains the Type of the file (application, audio, image,multipart, text, video, ... ).

Syntax
.TypeMIME

Return Value
Returns a String value.

Example

<%
Response.Write("
MIME Type=" & MyUpLoad.Files.Item(2).TypeMIME)
%>

SubTypeMIME

The SubTypeMIME property contains the sub-Type of the file.

Syntax
.SubTypeMIME

Return Value
Returns a String value.

Example

<%
Response.Write("MIME Sub-Type=" & MyUpLoad.Files.Item(2).SubTypeMIME)
%>

IsMissing

The IsMissing property returns a boolean which indicates if user has not specified a file.

Syntax
.IsMissing

Return Value
Returns a Boolean value.

Example

<%
If MyUpLoad.Files.Item(2).IsMissing Then
    Response.Write("There is no specified file.")
End If
%>

BinaryData

The BinaryData property contains the byte corresponding to the table index containing the transmitted data.

Syntax
.BinaryData (lngIndex)

Return Value
Returns a byte value.

Parameter

lngIndex is an index of the byte's array.

Example

<%
for i=0 to MyUpload.Files.Item(2).size - 1
    Response.Write( Chr( MyUpLoad.Files.Item(2).BinaryData(MyIndex) ) )
next i
%>

SaveAs

The SaveAs method saves file in the specified directory. This method always overwrites existing files.

Syntax
.SaveAs (FilePathName)

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.

Examples

<%
myUpload.files.item(2).saveas "c:\temp\" & myUpload.files.item(2).filename
myUpload.files.item(3).saveas "/docs/" & myUpload.files.item(3).filename
myUpload.files.item(4).saveas "myFile.txt"
%>

FileToField

The FileToField method saves file in a record af a specified DataBase.

Syntax
.FileToField FieldName

Parameter
FieldName is the field of the RecordSet.

Example

<%
myUpload.files.item(2).FileToField myRecordSet.Field("FILE")
%>

2002 Advantys. All rights reserved.