?
Solved

ASP.NET file contentlength

Posted on 2007-08-08
7
Medium Priority
?
888 Views
Last Modified: 2013-11-26
I'm passing in a variable to a sub as a string.

Private Sub UpdateDb(ByVal filename As String)

I need to get the file length. (size)

When I was passing it in as a collection I could get the file lengthwith

Dim _size = filename.contentlength

I still need the file size...some help?
0
Comment
Question by:lrbrister
  • 3
  • 3
7 Comments
 
LVL 29

Accepted Solution

by:
David H.H.Lee earned 1000 total points
ID: 19654748
Dear lrbrister,
Try this:
Dim fileInfo As New System.IO.FileInfo(filename)
Dim _size as string
_size=fileInfo.Length 'result returned in bytes.

       
0
 
LVL 9

Expert Comment

by:Raju Srivatsavaye
ID: 19654752
Is it possible to pass the file length as the parameter too!!
0
 

Author Comment

by:lrbrister
ID: 19656248
x_com:
  That gives me the character length.  I need the file size
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 9

Expert Comment

by:Raju Srivatsavaye
ID: 19656445
to get the file size in kb do this..

filename.length/1024
0
 

Author Comment

by:lrbrister
ID: 19656664
srivatsavaye:
filename.length gives me the characterlength of the filename.
0
 
LVL 9

Assisted Solution

by:Raju Srivatsavaye
Raju Srivatsavaye earned 1000 total points
ID: 19656844
sorry it should be file.contentlength/1024
0
 

Author Comment

by:lrbrister
ID: 19656975
That's it guys.  Thanks and splitting points
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses
Course of the Month16 days, 7 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question