I have a web app running on IIS 7 and I have a hyperlink to a .dot (Microsoft Word template) document (mytemplate.dot).
However, when the users (or myself) try downloading it, they got the file as a Word normal document (mytemplate.doc).
I've tried to modified the MIME type of .dot file from application/msword to application/dot; and also have tried removing the MIME type completely, but the results are the same.
When does it become a .doc file, when it's downloaded (transformed in the download process) or is it just prompting you to save it as a .doc file (which is standard behavior for templates).
Related
We created an XLSX file using Excel 2013 (packaged it within the WAR file) and gave a hyperlink to this file for users to download it. Application is hosted in Tomcat server.
Users using IE 11, when downloading this file, it is getting downloaded & saved as .XLS extension.
Users using Chrome, when downloading this file,it is XLSX extension.
It is a direct download hyperlink to the file. Why is it behaving differently in both browsers ? What could be the root cause of this issue ?
We were having the same problem - .xlsx files were only downloading as .xls and causing annoying warnings for the users when they tried to open the file, because it was opening the file as an .xls so the contents did not match the format, but it worked fine in Chrome.
We found that had two entries for the .xlsx MIME Type in IIS:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
and
application/vnd.ms-excel
When we removed the second one (vnd.ms-excel), the file downloaded appropriately and we were able to open the document directly without the error message.
It appears that the second mime-type entry caused Internet Explorer to treat all excel files as .xlsx. Now, why it does that, I'd love to know.
Hope this helps.
I'm trying to find out how to change the file extension of a file in a document library in SharePoint, so that a newer version with a different extension can be uploaded without a separated copy being created (e.g. suppose I want to replace a .doc file with .zip).
Looks like you can write some codes to workaround but I feel there's gotta be a simpler way to do a simple task like this.
You could change the extension by opening the library in windows explorer.
Actions - Open In Windows Explorer
Then ensure that in your file view settings you don't have 'Hide Extensions for known file types' enabled.
We would like to be able to upload files with a .std extension to a list on our SharePoint Foundation site, but get an error message when we try: "Unable to read cabinet info from". I assume it is because SharePoint templates use the same extension.
My question is thus, is there a way to enable upload files with .stp extension without breaking SharePoint, possibly on a list-by-list basis?
Best regards, Egil.
The problem is that the STP extension is the web/list template extension of SharePoint, which is basically a CAB (cabinet) file (a kind of compressed file format). SharePoint will attempt to open the cabinet to extract data from it, such as template title and language. As your STP files are in the wrong format, this fails. I would suggest changing the extension prior to uploading (e.g. zip the files).
I am uploading EML files to sharepoint document library.
The problem is that after uploading the file when i click on the link of the EML file from the document library, it will be opened in html format, so i can't see the attachment,cc...
How to solve this problem?
I want the eml file to be opened in windows mail.
I believe this is more of a client integration issue than a SharePoint issue. What is the default association for .EML files on your system?
Check this link to associate .EML files with a particular program, e.g. Windows Mail so they open with that program:
http://email.about.com/od/outlookexpresstroubles/qt/et_eml_oe.htm
I am sure there is a simple answer to this one.
I have a docx file that I get an error when trying to download(document cannot be found).... .doc is fine .txt is also fine. I am sure this is just an iis setting, the permissions on the server are all the same for all files.
Yes, it's just an IIS setting: by default, it will only serve files for which the extension matches a defined MIME type.
To allow .docx files to be downloaded, follow the steps from the KB article linked above:
Open the IIS Microsoft Management Console (MMC), right-click the local computer name, and then click Properties.
Click MIME Types.
Click New.
In the Extension box, type the file name extension that you want (in this case, .docx).
In the MIME Type box, type application/vnd.openxmlformats-officedocument.wordprocessingml.document (thanks to #web developer for pointing out this MIME type, which supercedes the 'application/msword' from my original answer).
Apply the new settings. Note that you must restart the World Wide Web Publishing Service or wait for the worker process to recycle for the changes to take effect. In this example, IIS now serves files with the .docx extension.
Note that the KB article uses the generic application/octet-stream MIME type: although that generally should work, if a more specific MIME type exists, such as application/msword, it's always best to use that.
In step 5 of the solution above you said
In the MIME Type box, type application/msword.
The "application/msword" MIME type is the type for the word 2003 ".doc" files. The correct MIME type for word 2007 ".docx" files is:
application/vnd.openxmlformats-officedocument.wordprocessingml.document
See this post.
Thanks this is very useful.
If you are interested MIME type for .pptx (Powerpoint 2007) is
application/vnd.openxmlformats-officedocument.presentationml.presentation
and .xlsx (Excel 2007) is
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
[These where transposed. I have corrected now, thanks for pointing it out Sven.]
When there is no mime type associated with an extension in IIS (6.0 and up), it will give you 404. See Requests for static files return 404 error (IIS 6.0). (Edit: The original MSDN link is dead as of mid-2017, the Internet Archive has a copy. Even though it was written for IIS6, the information still applies to modern IIS versions.)
Other than that, and just because you did not specify where the error shows up: When you forbid caching in a header, similar behavior may occur on the client. But that is a general issue, and not bound to .docx.