MATLAB: Do I get .txt extension eventhough it isn’t


Whenever I download a .mat file from this forum I get .txt extension appended at the ended. Why is it so ?

Best Answer

  • That reminds me that's something I wantedto discuss with Mathworks as it's indeed annoying.
    The reason has nothing to do with your OS or your file association. The behaviour will depend entirely on your browser but ultimately it's a defect in the way Answers serves these mat file.
    The mat files are served with a content-type of text/plain. So, stricly speaking a browser that download these files should consider them as text files. Firefox does this and since the website tells it that the file is text, it adds a txt extension to the file. Other browsers may ignore the content-type and save it as is. Really, Answers should send this file with the correct Content-Type.
    I'll try to get them to fix that.