Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Anytime I post a zip file with a renamed extension to .anything, it will always download as a .zip file. I have organizations that need to download these files, but cannot download .zip files. Is there anyway to have SharePoint not convert the file to .Zip when downloading? I do this all the time on ftp sites to bypass the security issue, but it just doesn't work here.

Thanks!

share|improve this question
add comment

3 Answers

I don't think SharePoint cares about what's in the file, just the extension of it. I'd bet this is IIS and the client browser since there's not a mime type for '.anything'. It's similar to what happens when you download a docx when there's no associated mime type: the browser asks to save the docx as a zip file. Try adding a MIME type of (I think) 'application/octet-stream' for extension '.anything'.

share|improve this answer
    
Well the .anything was more figurative. I changed the .zip to a .jpg and it still downloaded as a .zip instead. –  Eric P Nov 12 '09 at 18:41
    
I figured, ya. Just meant that I think you need a dedicated mime type for the extension you've chosen. Do you get the same result with other browsers (chrome, firefox, etc.)? –  vinny Nov 12 '09 at 18:44
add comment

This is called "magic numbers": first few (usually 3) bytes in a file that identify its format. For instance, ".jar" Java files have 0xCAFEBABE leading bytes. Look through SharePoint configuration, and disable "magic numbers" if there's any option for that.

Also, try other archiving algorithms: i believe it won't recognize *.7z (7zip).

share|improve this answer
    
.jar files are just .zip files, so it will have the magic number for zip archives. Java .class files, however, do use the magic number you mentioned. Nevertheless, I agree. tar+gzip/bzip2, 7zip, or rar are suitable alternative archiving formats that usually get through security checks. –  Suppressingfire Nov 11 '09 at 16:04
    
Ehm, sure it's *.class! I saw "CAFEBABE" only once in something connected with Java. Brain's not perfect :) –  kolypto Nov 11 '09 at 19:37
add comment

Try creating a new content type, starting from Document. Then remove(hide?) the file-type attribute.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.