LDraw.org Discussion Forums

Full Version: view diff is broken?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
On the parts tracker whenever I click on "view diff" my browser (Google Chrome) downloads a file called "ptdatdiff.cgi" which i can't open. I know chrome is compatible with .CGIs because it had to use ptdetail.cgi to get to the "view diff" link. Anybody know why this might be happening?
Firefox has the same problem.
The contents of the downloaded file is a concatenation
of the two files to be compared.

Here's a link to the function:
Click on "DAT Diff".
still does the same thing. whenever I click go it downloads ptdatdiff.cgi.
Do you have a default program a assigned to .cgi files? I don't and when I download I'm prompted for the program to use and can choose, for example, LDView. It should be fixable, but I'm unlikely to have time to look at it this week.
Yes, that is correct.
Please download that file (ptdatdiff.cgi) and open it with LDView.
The content of the file **is** the comparison!

LDView will not open directly, like PDF files with Acrobat Reader will do!
I have found the following on this (http://www.tek-tips.com/viewthread.cfm?qid=1175419) page:

CGI programs can return a myriad of document types.
They can send back an image to the client, and HTML document, a plaintext document, or perhaps even an audio clip.
They can also return references to other documents.
The client must know what kind of document you're sending it so it can present it accordingly.
In order for the client to know this, your CGI program must tell the server what type of document it is returning

Maybe this helps us to improve that tool.
that makes more sense now, though perhaps that should be made more apparent on the parts tracker.
Chris, I think the solution is very simple.
You just need to make sure that the HTTP header sent in the response from the server states the proper MIME type for LDRAW files. The element you need to send back to the client is
the "Content-Type" field in the HTTP response header.
The user can then associate a tool with that MIME type.
As "LDRAW" is of course not part of the official MIME standard, we need to use the "x-" prefix for unofficial file types.
would be something good IMHO.
Alternatively, you could make the URL "appear" as an *.ldr file (instead of *.cgi), so users might,
alternatively to the MIME type, use their normal file associations for opening the result file.
Since the result - as far as I can see - is a mix of both the old and the new version of the file,
probably either *.mpd or *.ldr would be a good file extension to pick; not *.dat
Yes, aware of that. An unofficial MIME type of application/x-multi-part-ldraw has been defined in the past for MPD files.
I just checked and ptdatdiff.cgi does set the response header content type to application/x-ldraw. At least that's what the code does and that's what Firebug sees.
Pages: 1 2