- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsHi, I'm using asp.net and a gembox Excel DLL to read/write excel files. The writing aspect works well using the following code, which prompts the user where to save the file.
//ef is the ExcelFile object.
Response.Clear();
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("Conten
ef.SaveXls(Response.Output
Response.End();
Now, I need to figure out how to read the file using the ef.LoadXls function. It works fine if I hardcode the file to the local machine, but how do I get it to prompt the user through the web interface and allow them to select/upload the file?
Thanks,
Terry
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: asp_lhaPosted on 2007-04-09 at 17:54:03ID: 18879693
first, you need to prompt the user to upload a file (show some help)
ataaccess/ tutorial54 vb.aspx? ta bid=63):
h, _ entType)
s/" & UploadTest.FileName) )
then upload the file where the user selected to a temp. directory
and use the ef.LoadXls to load the file.
sample code for upload file
(come from http://www.asp.net/learn/d
Protected Sub UploadButton_Click(sender As Object, e As EventArgs) _
Handles UploadButton.Click
If UploadTest.HasFile = False Then
' No file uploaded!
UploadDetails.Text = "Please first select a file to upload..."
Else
' Display the uploaded file's details
UploadDetails.Text = String.Format( _
"Uploaded file: {0}<br />" & _
"File size (in bytes): {1:N0}<br />" & _
"Content-type: {2}", _
UploadTest.FileName, _
UploadTest.FileBytes.Lengt
UploadTest.PostedFile.Cont
' Save the file
Dim filePath As String = _
Server.MapPath("~/Brochure
UploadTest.SaveAs(filePath
End If
End Sub