Resolving 404 (Not Found) issue. Setting mime type for PDF WebViewer files

676 views
Skip to first unread message

Support

unread,
Mar 16, 2012, 3:13:41 PM3/16/12
to pdfnet-w...@googlegroups.com
Q:
 
I tried putting a sample XOD and WebViewer (http://www.pdftron.com/pdfnet/webviewer/demo.html) online so you could see it occurring but when I did it is unable to load in the xod document. It just gives a 404 error in HTML5 viewer.
 
Failed to load resource: the server responded with a status of 404 (Not Found)
Uncaught Error retrieving file: data/flash_sample.xod. Received return status 404. CoreControls.js:63
 
The file is definitely there so the only reason I can think of is that the server is not setup to recognise xod documents so it doesn’t service them.
 
------------------
 
A: Here are some suggestions from our developer on how to deal with the issue:

 

Most likely the MIME-Type is not set for .xod extension. They get a 404 because their web server does not know how to handle the resource "data/flash_sample.xod".

They can do three things:

1. Set up the
MIME
-Type correctly on the servers hosting the .xod file. The common mime-type is "application/vnd.ms-xpsdocument" if they want the xod to be viewable in IE's XPS viewer, or they can use the generic "application/octet-stream".

2. Change the extension of the .xod file. Most likely, .bin should be fine because .bin have "application/octet-stream" MIME type.

3. Use the WebViewerStreaming sample we have and create a simple web service that will serve the .xod files.

This is a server policy matter (server decides whether to serve the file or not) so there's really nothing we can do on the client side.

It could also be that the file permission prevents the web server from accessing the file itself, thus another 404.

Reply all
Reply to author
Forward
0 new messages