I have written some code which uploads a file.
Before I upload the file I would like to check on the file size. If its below a certain limit I want to upload it else present the user with an error message.
Any Ideas ?
Printable View
I have written some code which uploads a file.
Before I upload the file I would like to check on the file size. If its below a certain limit I want to upload it else present the user with an error message.
Any Ideas ?
First I didn't check the code but it looks it should work .
VB Code:
Private Sub CheckFileSiz(ByVal File As String) 'Parameters : File = provide full path Dim Finfo As New IO.FileInfo(File) Dim Siz As Integer If IO.File.Exists(File) Then Siz = Finfo.Length Else Exit Sub End If Select Case Siz Case 100 '100k 'Do this Case 200 '200 k 'Do this Case 300 '300k 'Do this Case Is <= 500 'k 'Do this Case Is <= 1000 'k 'Do this End Select End Sub