Solved

Excel File Upload in VB.NET

Posted on 2009-06-30
5
591 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 19

Assisted Solution

by:daveamour
daveamour earned 30 total points
ID: 24751683
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
ID: 24751714
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
ID: 24751846
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
ID: 24759638
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
ID: 24760805
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

717 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