Skip to main content
Topic: Problem opening nwc file edited in 2.5.4. when opened from website (Read 5391 times) previous topic - next topic

Problem opening nwc file edited in 2.5.4. when opened from website

Not the question I hoped for as my first post ...
I upgraded to 2.5.4 this morning (GMT+1), and after that I edited a few 2.5 nwc files which I uploaded to our website.

I can open the files from my computer, and they play fine. But when I open the files I edited with version 2.5.4 from our website, NoteWorthy Composer is not started. Instead  I get a page of gibberish.
It begins with:
[NWZ]xÚíËnDZzâz9˵AÆjyðÅTlÉɇ‘mäb€!—NŒÀ1¬%¹‰H\™\%J.>äää‚œ‚¹ä?ò9ĹŰ$®¸ô"Õï<œõO?†Ðóäw;?¸ ož<ÞÙ{ï觟uw>>¸}ü»Çïüdÿgð¯ø߁lm8:>í'þÙùù'ðã;² àÍÛ?|3ûÓ®*4às(ÿ3ƒ&|pü ÖÞéÿ¦Ý<蝀U'vl0í¾Ç´ûS׸ººY:o!ÿBú/’Ù<<í ²ß²Ý>Àþ°wrÔ;=¢äúD¯m¿ýþ/ (...)

The older 2.5 files on the web page (which I have not changed) open as they should in NoteWorthy Composer 2.5.4, but only once. The second time I open the (unchanged) file, I get the same kind of gibberish.

This only happens when I use my standard browser IE9, in Google Chrome things work all-right. So it looks like it is browser related. I should also mention that I just tried out the new NWC-viewer before I put it on the website for my fellow choir members to use.
After that I de-installed the viewer. Is it possible that this damaged my IE9 installation somehow?

Any ideas what is happening, and how I can remedy it?

Re: Problem opening nwc file edited in 2.5.4. when opened from website

Reply #1
This sounds like a classic MIME type issue where the web site is indicating the data is text, and the browser attempts to display it.

What is your web site? We will take a look. If you do not want to share it publicly, then send a personal message to this account.

Re: Problem opening nwc file edited in 2.5.4. when opened from website

Reply #2
It looks like the web site is not sending the correct MIME type for *.nwc files. This is explained in more detail here:

FAQ - Adding *.nwc files to your web site
http://ntworthy.com/composer/faq/94.htm

Since your site is using Apache, you should be able to solve the problem using an .htaccess file, as explained in that page. The changing behavior from IE is probably due to its download cache.

Re: Problem opening nwc file edited in 2.5.4. when opened from website

Reply #3
Thank you Eric. This is most helpful. Unfortunately my hosting company does not want to change the content type for nwc files, so I probably have to follow up on your alternative solution and teach myself php. I was a programmer once (in the days of Fortran and Pascal, etc.), so I should be able to learn how to put the right php statements in my (very simple HTML3) website. 

Re: Problem opening nwc file edited in 2.5.4. when opened from website

Reply #4
Adding a .htaccess file is often something you can do yourself, especially if your host is allowing you to script your web site with PHP. Are you sure that they are blocking you from using .htaccess?

You can also solve this from PHP, but it is not as elegant. Here is a simple (untested) function that might give you some ideas:

Code: (php) [Select · Download]
function DownloadNWCFile($fname)
{
Header("Content-Type: application/x-nwc",true);
Header("Accept-Ranges: none",true);
Header("Content-Length: ".filesize($fname));
readfile($fname);
exit;
}

Re: Problem opening nwc file edited in 2.5.4. when opened from website

Reply #5
Storing your files on the website as .nwctxt might be another solution.
Since 1998

Re: Problem opening nwc file edited in 2.5.4. when opened from website

Reply #6
Thank you again. My issue is now completely solved.
The step that was missing in my info was what to do with the .htaccess file.

I complained to my webhoster, telling them that 'in my opinion one should not accept a job in a helpdesk in case one feels that questions from non-expert clients are a waste of time'. And I took the liberty to point to your reaction as an example of how else they might have responded. And just ten minutes ago I got a reaction with an apology, and a one line explanation on what to do with the .htaccess file they sent with it (exactly the same content as your version from the faq of course); i.e. 'just put it in the same folder as the nwc files on the web server'). It is so simple, once you know it ...  

Re: Problem opening nwc file edited in 2.5.4. when opened from website

Reply #7
It might be worth updating the FAQ to say where the .htaccess file needs to go to be effective?

Re: Problem opening nwc file edited in 2.5.4. when opened from website

Reply #8
The step that was missing in my info was what to do with the .htaccess file.

I added a short paragraph to the FAQ recommending that the .htaccess file be placed in the web site's home folder. I also added a direct link to the Apache documentation for .htaccess files.