Upload XLSX file

  • Thread starter Thread starter Madison
  • Start date Start date
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.
 
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?
 
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.
 
Have anyone know about this issue after instatlled office update? Should I
call microsoft support?
 
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
 
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.
 
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
 
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.
 
Back
Top