view diff is broken?


view diff is broken?
#1
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?
Reply
Re: view diff is broken?
#2
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:
http://www.ldraw.org/library/tracker/tools/
Click on "DAT Diff".
Reply
Re: view diff is broken?
#3
still does the same thing. whenever I click go it downloads ptdatdiff.cgi.
Reply
Re: view diff is broken?
#4
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.
Chris (LDraw Parts Library Admin)
Reply
Re: view diff is broken?
#6
I have found the following on this (http://www.tek-tips.com/viewthread.cfm?qid=1175419) page:

Code:
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.
Reply
Re: view diff is broken?
#8
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.
Probably
application/x-ldraw
or
model/x-ldraw
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
Reply
Re: view diff is broken?
#9
Yes, aware of that. An unofficial MIME type of application/x-multi-part-ldraw has been defined in the past for MPD files.
Chris (LDraw Parts Library Admin)
Reply
Re: view diff is broken?
#10
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.
Chris (LDraw Parts Library Admin)
Reply
Re: view diff is broken?
#11
Ah, thanks for checking.
In the meantime I have discovered here what had caused the behaviour for me in Firefox:
In Firefox you can configure what shall happen with what filetypes, and I had set "LDRAW Part" to "Save",
because this is the only thing I want to do when working with files from the PT.
Thus, the saving of the DIFF result was in fact a proof that the LDRAW server sent the proper information.
Reply
Re: view diff is broken?
#12
Where can you set that in Firefox?
I only know the "Einstellungen" and there the tab "Anwendungen". But in that list there is no x-ldraw type or any similar entry. Also I can not add a new mime type!

Please help.
Reply
Re: view diff is broken?
#13
see here

http://kb.mozillazine.org/File_types_and...ad_actions

http://kb.mozillazine.org/MimeTypes.rdf

http://serverfault.com/questions/19098/h...in-browser
Reply
Re: view diff is broken?
#14
Thanks Steffen, that should exactly be what I need. But now I see that in Thunderbird x-ldraw is already set.
Code:
<RDF:Description RDF:about="urn:mimetype:externalApplication:application/x-ldraw"
                   NC:prettyName="LDView.exe"
                   NC:path="E:\LDraw\Apps\LDview\LDView.exe" />


But this is not shown in Firefox!?

Because it seems to work for your in Firefox as well, can you please share your entry, so I do not need to read through all that stuff ? Smile

Just found another entry:

Code:
<RDF:Description RDF:about="urn:mimetype:handler:application/x-ldraw"
                   NC:handleInternal="false"
                   NC:alwaysAsk="false"
                   NC:useSystemDefault="false"
                   NC:saveToDisk="true">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-ldraw"/>
</RDF:Description>


And another one:

Code:
<RDF:Description RDF:about="urn:mimetype:application/x-ldraw"
                   NC:value="application/x-ldraw"
                   NC:editable="true">
    <NC:fileExtensions>ldr</NC:fileExtensions>
    <NC:fileExtensions>dat</NC:fileExtensions>
    <NC:fileExtensions>mpd</NC:fileExtensions>
    <NC:description>LDraw-Datei</NC:description>
    <NC:description>LDraw-Parts-Datei</NC:description>
    <NC:description>Multipart-LDraw-Datei</NC:description>
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-ldraw"/>
</RDF:Description>
Reply
Re: view diff is broken?
#15
Thanks Steffen, that should exactly be what I need. But now I see that in Thunderbird x-ldraw is already set.
<RDFBig Grinescription RDF:about="urn:mimetype:externalApplication:application/x-ldraw"
NC:prettyName="LDView.exe"
NC:path="E:\LDraw\Apps\LDview\LDView.exe" />

But this is not shown in Firefox!?

Because it seems to work for your in Firefox as well, can you please share your entry, so I do not need to read through all that stuff ? Smile

Just found a second entry:
<RDFBig Grinescription RDF:about="urn:mimetype:handler:application/x-ldraw"
NC:handleInternal="false"
NC:alwaysAsk="false"
NC:useSystemDefault="false"
NCConfusedaveToDisk="true">
<NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-ldraw"/>
</RDFBig Grinescription>
Reply
Re: view diff is broken?
#5
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!
Reply
Re: view diff is broken?
#7
that makes more sense now, though perhaps that should be made more apparent on the parts tracker.
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)
Forum Jump:


Users browsing this thread: 1 Guest(s)