Solved

Excel File Upload in VB.NET

Posted on 2009-06-30
5
588 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 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