Upload XLSX file

M

Madison

Hi all,
I have web application that allow users to upload files (pdf, xls, zip,...)
and save file to SQL Sever and have page to view the file. This process been
working for about 5 years until the new Office 2007 release. How do I handle
with Office 2007 upload? I try to upload xlsx and save to database but I can
not view or retrieve it.
Any suggestions. Thanks.
 
T

Thomas Bandt

Madison said:
I have web application that allow users to upload files (pdf, xls, zip,...)
and save file to SQL Sever and have page to view the file. This process been
working for about 5 years until the new Office 2007 release. How do I handle
with Office 2007 upload? I try to upload xlsx and save to database but I can
not view or retrieve it.
Any suggestions. Thanks.

It's totally impossible to give you any advise without knowledge about
your concrete process and code. What's your problem - to store the new
Excel files into your SQL Server, to download it or to open it directly
within the users browser?
 
M

Madison

Thank you Thomas and Mark for quick reply. Sorry that I did not make it clear.
Here is process I stored file to table, after that I need to read the file.
I use the following codes to read the file

Response.ClearContent()
Response.ClearHeaders()
Response.Clear()
If dr.Read Then
Response.ContentType =
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
Response.AddHeader("Content-Disposition", "no-cache")
Response.BinaryWrite(dr("doc_image"))
End If
Response.Flush()
Response.End()

then I will get the popup window say
Do you want to open or save this file?
Name: viewdocument.xlsx
Type: Microsoft Office Excel Worksheet
From: locallhost
I click Open, then I got the popup window say “Execl found unreadable
content in 'viewdocument.aspx'. Do you want to recover the contents of this
workbook? If you trust the source of this workbook, click Yes.
I did click Yes then the other window popup say "Excel cannot open the file
'viewdocument.aspx' because the file format or file extension is not valid.
Verify that the file has not been corrupted and that the file extension
matches the format of the file", now only OK button. I click Ok then nothing
happen. With other file format (pdf, zip) I just change Response.ContentType.
Thanks.
 
M

Madison

Have anyone know about this issue after instatlled office update? Should I
call microsoft support?
 
A

Andrew Morton

Madison said:
then I will get the popup window say
Do you want to open or save this file?
Name: viewdocument.xlsx
Type: Microsoft Office Excel Worksheet
From: locallhost
I click Open, then I got the popup window say "Execl found unreadable
content in 'viewdocument.aspx'.

What if you click Save instead and examine the contents of the xlsx file
(which is actually like a zip file, so you could open it with 7zip or
similar to see what's inside)?

http://en.wikipedia.org/wiki/XLSX

Andrew
 
M

Madison

Thank you Andrew for your reply. I tried to save as and change the ext to zip
file, I saw about 14 files (sheet1.xml, sheet2.xml,
styles.xml,sharedStrings.xml,...) when I opened sheet1.xml, I can see the
content of page. But why can open xlsx file directly? If I saved to
hard-drive and open it, I still get the popup that say "Excel found
unreadable content in 'sssss.xlsx'. Do you want to recover the contents of
this workbook? If you trust the source of this workbook, click Yes." I did
click Yes then I got the other popup say "Exce cannot open the file
'sssss.xlsx' because the file format of file extension is not valid. Verify
that the file has not been corrupted and that the file extension matches the
format of the file." I click OK, only the blank excel display. Do you have
any idea what is going on? Thanks.
 
A

Andrew Morton

Madison said:
Thank you Andrew for your reply. I tried to save as and change the
ext to zip file, I saw about 14 files (sheet1.xml, sheet2.xml,
styles.xml,sharedStrings.xml,...) when I opened sheet1.xml, I can see
the content of page. But why can open xlsx file directly? If I saved
to hard-drive and open it, I still get the popup that say "Excel found
unreadable content in 'sssss.xlsx'.

This is where you do things like comparing the length of the downloaded file
to the one you uploaded, in case it got truncated somewhere, and if the file
lengths are the same then compare the files with something like the fc
command.

Andrew
 
M

Madison

Thank you for your reply. I compared the length of both files. They are
matching. But the network person recomment that may be the service pack 2
need to install.
I will give it a try. Thank you again for your help.
 
Joined
Sep 10, 2010
Messages
1
Reaction score
0
Hi, I appreciate that this thread is now quite old but I have experienced the exact same problem with uploading/browsing .xlsx files and would like to know how you fixed it.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top