Forums

This topic is locked

Showing file size giving errors

Posted 27 Oct 2001 16:05:22
1
has voted
27 Oct 2001 16:05:22 suhail kaleem posted:
hi !
i am trying to show file size with the following code but it always give me errror
Type mismatch: '[string: "okabe1.swf"]'


following is the code that i am using



<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/faraz.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
if (Request.QueryString("uniqueid" <> "" then Recordset1__MMColParam = Request.QueryString("uniqueid"
%>
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset"
Recordset1.ActiveConnection = MM_faraz_STRING
Recordset1.Source = "SELECT * FROM attach WHERE uniqueid = '" + Replace(Recordset1__MMColParam, "'", "''" + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%


Function ShowFileSize(filespec)
file = Server.MapPath(filespec)
Set fso = CreateObject("Scripting.FileSystemObject"
If fso.FileExists(file) Then
Set f = fso.GetFile(file)
intSizeB = f.Size
intSizeK = Int((intSizeB/1024) + .5)
If intSizeK = 0 Then intSizeK = 1
ShowFileSize = intSizeK & " kb"
Else
ShowFileSize = "File Doesn't Exist"
End If
Set fso = Nothing
End Function


response.write ShowFileSize(attatchment/(Recordset1.Fields.Item("Attatch".Value))

%>

<%
Recordset1.Close()
Recordset1.ActiveConnection.Close()
set Recordset1.ActiveConnection = Nothing
set Recordset1 = Nothing
%>




the baove code give me error Type mismatch: '[string: "okabe1.swf"]'

any help ?
suhailkaleem


Reply to this topic