I want to get the file size before uploading to server. I used following code
Dim fileDetails As IO.FileInfo
fileDetails = My.Computer.FileSystem.GetFileInfo(fil
Unfortunately you cannot check the file size on the client end. It shouldn't be that big of a deal, I have a few current production implementations allowing multiple file uploads that check the file size on server-side. It is not that long of a delay and I don't believe you will find a way around this.
Something to make note of, the web.config has setting within that determines the maximum length (in kilobytes) of a single request. By default, this is set to 4MB. So if your user is trying to upload more than this amount, he will receive a server error. Here is how you change this: