Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optimizing research on file type
Message
From
14/01/2016 08:58:22
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Optimizing research on file type
Environment versions
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01629800
Message ID:
01629800
Views:
42
I have a FileType class which I am using to get the file type of a file. The goal consists of loading the file into a string and analyzing the bytes of the string to detect if a known file type is recognized.

In that FileType() method, I am loading the file into memory such as this:
				Using loStreamReader As New StreamReader(lcFile, System.Text.Encoding.Default)
					cString = loStreamReader.ReadToEnd()
				End Using
In our daily operations, we process about 4000 zip files, where each of them contains about 30 or more files, where I have to get the file type of each. So, basically, this method is called about 120000 times on a daily basis. I see this is, of course, impacted by the size of the file. So, if the file is bigger, it will take more time to do the above.

Would there be any faster way to achieve this?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform