|
Blue Forest http://www.lslnet.com at 8:28 on August 25, 2006
Access to server file size?
Document has been uploaded to the server, browse A paper on the stage, what we call document size KB |
[html]
"Script>
Alert ( "document addresses :" +location.href+ "\r\n file size :" +document.fileSize + "byte");
"/script>
[/html]
|
First, thanks! I mean, in an ASP PAGES, KB or MB converted into what? The following are my existing code :
"% If rs = (" SoftSize ")," then 1024
Response.Write (round (rs = ( "SoftSize") /1024,2) & "MB")
Else
Response.Write (rs = ( "SoftSize") & "KB")
End if
%> |
Khan. . . . . . The question to ask ah background area. . . .
I do not understand the meaning of your existing code, the size of your document data stored in a database?
If not, use FSO bars. . . . . .
<%
Dim fileSize
Set fso=Server.CreateObject ( "Scripting.FileSystemObject")
Set f=fso.getFile (filePath)
FileSize=f.size 'seems to be the nature, I remember very clearly
%> |
[code]<%
Dim FileName, Fso, Fout
FileName = "http://www.unescap.org/epoc/index.asp"
Set Fso = Server.CreateObject ( "Scripting.FileSystemObject")
Set Fout = Fso.GetFile (Server.MapPath (FileName))
Response.Write ( "Document Name :" & & Fout.Name "" School Official Cites Use ")
Response.Write ( "short paper path name :" Fout.ShortPath & & "" School Official Cites Use ")
Response.Write ( "physical address document :" Fout.Path & & "" School Official Cites Use ")
Response.Write ( "document attributes :" Fout.Attributes & & "" School Official Cites Use ")
Response.Write ( "paper size :" Fout.Size & & "" School Official Cites Use ")
Response.Write ( "document types :" Fout.Type & & "" School Official Cites Use ")
Response.Write ( "document creation time :" Fout.DateCreated & & "" School Official Cites Use ")
Response.Write ( "recent visit :" Fout.DateLastAccessed & & "" School Official Cites Use ")
Response.Write ( "recently changed the time :" & Fout.DateLastModified)
Fout = Nothing Set
Set Fso = Nothing
%>[/code]
Attributes which returned to the value "32" : (Archive), the document has been changed after the last backup. Can read and write.
Appendix other values as follows :
Normal 0 ordinary document. Not set any attributes.
ReadOnly one CD document. Can read and write.
Hidden two hidden documents. Can read and write.
System 4 documentation. Can read and write.
Directory 16 folders or catalog. CD.
Backup Archive has changed in the last 32 documents. Can read and write.
Alias 1024 link or shortcut. CD.
Compressed 2048 compressed documents. CD. |
|