Solved

Excel File Upload in VB.NET

Posted on 2009-06-30
5
581 Views
Last Modified: 2012-05-07
Hi,

Can I check if VB.NET's FileUpload function validates the content of an Excel file?

Because my IT guy told me that the Excel file that I've uploaded is not a proper Excel file although it is an *.xls, and the content when opening with a notepad looks like such:

<html xmlns:o="urn:schemas-microsoft-com:office:officexmlns:x="urn:schemas-microsoft-com:office:excelxmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=windows-1252"><meta name=ProgId content=Excel.Sheet><meta name=Generator content="Microsoft Excel 10"> . . . . . .
0
Comment
Question by:cukcuk
  • 2
  • 2
5 Comments
 
LVL 19

Assisted Solution

by:daveamour
daveamour earned 30 total points
Comment Utility
It doesn't validate.
What version of Office are you using?
Newer versions I believe can save as xml so that may be an issue particularly if your colleague is trying to read it in an older version of Excel.
0
 

Author Comment

by:cukcuk
Comment Utility
We're using Office 2003.

Opening the Excel using File - Open is not an issue.

Just that we are developing a web application to upload Excel files. So I'm wondering if the FileUpload do any kind of content validation at client or server side.
0
 
LVL 18

Accepted Solution

by:
Ajay Sharma earned 70 total points
Comment Utility
As you said you are using Office 2003, and the file information states that it's an version 10 (which is Office 2002), which means there should not be any version compatibility issue.

Regarding the FileUpload control, it can only check the extension of file, and it can't validate the file content.
0
 

Author Comment

by:cukcuk
Comment Utility
Oh.. is there any way for a function to validate an Excel file content in that case?

Thanks..
0
 
LVL 18

Expert Comment

by:Ajay Sharma
Comment Utility
The file can be validated only by the IT guy.
Ask him to write a code which will do the following:
1) first step, upload the file.
2) After uploading, open the file using code and look for  columns and sheets according to your business logic.
3) If the above condition is satisfied then your file format is ok, Else its in bad format.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now