Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Excel File Upload in VB.NET

Posted on 2009-06-30
5
Medium Priority
?
606 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 90 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 210 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

609 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