Skip to main content
1-Visitor
December 15, 2015
Solved

The file type is not supported, error, PTC mathcad prime 3

  • December 15, 2015
  • 3 replies
  • 8342 views

Hello All

Recently I have been working on my mathcad file which  include formulas and some pictures and it worked fine for a while. I was able to close it every single day  and open the file next day. But today I cannot open the file. The application I have on my system is PTC mathcad prime 3 and I havnot updated or change it since I installed it on my machine. I'm able to open other mathcad files but not this file. The log file says:

Exception data:

File being opened: C:\.....\Desktop\MyCalculation.mcdx

FileFormatException when processing file

System.IO.FileFormatException: File contains corrupted data.

   at MS.Internal.IO.Zip.ZipIOEndOfCentralDirectoryBlock.FindPosition(Stream archiveStream)

   at MS.Internal.IO.Zip.ZipIOBlockManager.LoadEndOfCentralDirectoryBlock()

   at MS.Internal.IO.Zip.ZipArchive.OpenOnStream(Stream stream, FileMode mode, FileAccess access, Boolean streaming)

   at System.IO.Packaging.ZipPackage..ctor(Stream s, FileMode mode, FileAccess access, Boolean streaming)

   at System.IO.Packaging.Package.Open(Stream stream, FileMode packageMode, FileAccess packageAccess, Boolean streaming)

   at Ptc.Controls.EngineeringDocument.OpenPackage(FileLoadResult& result, String fileName, Boolean newFromDocument)

   at Ptc.Controls.EngineeringDocument.OpenFileForWorksheet(String fileName, String extension)

I have attached the mathcad and log file. Can you please help me?

Best answer by AndyWesterman

Final option that I can think of is to compare the contents of the zip archive against a known working sheet.

I have 7-Zip on my computer, but I'm sure that a lot of archive programs will be equally suitable.

The #2 file had a folder added from a working P2 sheet , but perhaps this isn't the best idea.

I know that prime is very bad at reporting errors, perhaps copying files from the recovered archive to a working sheet will point to the offending file.

Its very difficult to know given that I don't have the update to open the document.

Regards

Andy

3 replies

19-Tanzanite
December 16, 2015

If you have active maintenance you can ask PTC to try to recover your file.

mkhazraei1-VisitorAuthor
1-Visitor
December 16, 2015

Any idea why this is happening? I'm using mathcad on my company's computer. I do not have active maintenance.

19-Tanzanite
December 16, 2015

Do you mean why it got corrupted? I have no idea, but you are not the first to post here about a corrupted file from Prime.

Unfortunately, a .mcdx file is not plain text. It's actually a zip file; you can rename one with a .zip extension, and unzip it to see the XML, which is plain text. Since your file is corrupted I can't do that though, so I have no way to fix it.

12-Amethyst
December 17, 2015

Hi,

as others have said, the zip archive is corrupt.

For reference try searching the web for "repair zip" - there are many free & paid for programs.

I used zip_repair & I think that only the doc_props folder in the archive was corrupt.

#1 is the initial recovered file & in #2 I have copied the missing (?) folder from another (P2) worksheet.

Have a try with these & see if they work, unfortunately I don't have P3 so I can't test it here.

If there are still issues then, hopefully, someone with P3 or above can continue to help.

Regards

Andy

24-Ruby III
December 17, 2015

Your recovered both files can not be opened in Prime 3.1 version (the same error as in the original document).

12-Amethyst
December 17, 2015

Final option that I can think of is to compare the contents of the zip archive against a known working sheet.

I have 7-Zip on my computer, but I'm sure that a lot of archive programs will be equally suitable.

The #2 file had a folder added from a working P2 sheet , but perhaps this isn't the best idea.

I know that prime is very bad at reporting errors, perhaps copying files from the recovered archive to a working sheet will point to the offending file.

Its very difficult to know given that I don't have the update to open the document.

Regards

Andy

1-Visitor
November 8, 2016

I had a similar error in one of my Mathcad files. I'm posting to share what I found about the source of my particular error.

After restoring and old version of my file, I walked through the recent changes I had made to the document. closing and reopening it after each step to verify it wasn't corrupted yet. It turned out my error was caused when I changed the reference for an "include worksheet" to a file that had "#" in it's name.

Hope that helps somebody some day.

24-Ruby III
November 10, 2016

Josh,

Thank you for this tip.