在页面上下载EXECL文件时出错: 发生了DDE错误,并且该错误的说明由于太长而不能显示。如果文件名或路径太长,请尝试重新命名该文件或将其复制到其他文件夹中。
可是同样的路径同样的文件名下载WORD或者图片文件都没问题,而且只有EXECL文件会出这个错,请问这个问题如何解决?
看下面这个微软的说明,word 文档的最大路径长度为254字符,Excel为218,这就是为什么word可以,Excel不可以的原因。我觉得没有其他办法,只有通过缩短文件路径名来解决。
http://support.microsoft.com/kb/325573
his issue occurs because of a 256-character limitation on
creating and saving files in the Office products. Also, you receive an error message
when you save or open a file if the path of the file meets the following
situations.
Microsoft Word: The total length of the path and the file
name, including file name extension, exceeds 254 characters.
Microsoft PowerPoint: The total length of the path and the file name, including file
name extension, exceeds 258 characters.
Microsoft Access: The total
length of the path and the file name, including file name extension exceeds 258
characters.
Microsoft Outlook: The total length of the path and the file
name, including file name extension, exceeds 258 characters.
Microsoft Excel: The total length of the path and the file name, including file name
extension, exceeds 218 characters.
Note This limitation includes the three characters that represent the
drive, the characters in folder names, the backslash character between folders,
and the characters in the file name.
有可能是编码的问题,检查一下response.setHeader的设置与filename的URLEncoder.encode编码之后的情况。你可以把名字尽量缩短点试试看!另外
mimetype最好写清楚
Response.ContentType = "application/ms-excel";
路过,学习了....