Page 1 of 1

Error accessing Tim Pratt's responses

Posted: 07 Aug 2010 14:17
by Marghek
#13143 and #13144, Tim Pratts Preces and Responses in D minor give an error when trying to get the pdfs. The message for #13143 is:
Warning: fopen(/home/cpdl/public_html/www2/wiki/images/6/63/Preces_) [function.fopen]: failed to open stream: No such file or directory in /home/cpdl/public_html/www2/wiki/images/download.php on line 17

Warning: fclose(): supplied argument is not a valid stream resource in /home/cpdl/public_html/www2/wiki/images/download.php on line 47
I want to compare the two versions before asking a question ...

Re: Error accessing Tim Pratt's responses

Posted: 07 Aug 2010 15:40
by choralia
Thank you for notifying this problem. The ampersand (&) in the filename is something we should definitely avoid, as it has a very special meaning when passed as an URL. I've renamed this file so that the ampersand is not present any more. Please access the contributor website (http://www.cpdl.org - login required) to get it, as the renamed file will not be available on the visitor websites until tomorrow.

We will have to rename other files where the ampersand is also present.

Max

Re: Error accessing Tim Pratt's responses

Posted: 07 Aug 2010 20:27
by CHGiffen
Questions: Is it an isolated ampersand (&) that causes the problem (ie. an ampersand with space before and after)? Or is it possible that substituting the markup "&" for "&" will bypass the problem? Or will the presence of other such markups (eg. " " or "&Auml" or "è" or "Ç" ... ) cause the same problem?

It would be nice to have a suitable workaround, but if we have to change the filenames, then we must.

Added edit: Or, what about using "%26" in place of "&" when it appears in a filename (which is how the ampersand is translated into URLs)?

Chuck

Re: Error accessing Tim Pratt's responses

Posted: 07 Aug 2010 21:08
by CHGiffen
I've made three test pages with various ways of putting ampersands into the title at ChoralWiki. They are accessible by going to my talk page. Maybe they will prove helpful in testing?

Chuck

Re: Error accessing Tim Pratt's responses

Posted: 08 Aug 2010 00:00
by choralia
Thank you, Chuck, for your suggestions. Page names should not be affected by any problems, while I've found a way to somehow double-escape ampersand characters contained in file names, so for example the pdf file associated to this page:

http://www.cpdl.org/wiki/index.php/Prec ... m_Pratt%29

is now downloaded correctly despite the ampersand in the file name. It's a rather dirty trick, and I hope it causes no regression in other cases. What a headache! :shock:

Max

Re: Error accessing Tim Pratt's responses

Posted: 08 Aug 2010 11:05
by Marghek
Max,

Thanks for fixing that. I didn't expect to cause a problem [sorry!] and I am no expert on ampersand escape thingies.

But on a different tack, on music lists and so on it is usual to refer to "preces and responses" as "responses". Not very useful after the files have been named, I know. :(

And another thing - I actually don't like ampersand used other than in the title of firms (particularly solicitors(attorneys), accountants and so on). Like "Bloggs, Fubar & Scratchet". Just a "thing" of mine. :wink:

Re: Error accessing Tim Pratt's responses

Posted: 08 Aug 2010 21:10
by choralia
Hi Alan,

No problem, I should actually thank you for having highlighted this issue with the ampersand character. This also allowed me to identify a similar issue with the "+" character in the file name, that I've fixed before anyone may have noticed it.

I totally agree with you about the use of the "&" character, however ChoralWiki is a wiki, and thus it is open to everybody's contributions. If a contributor wants to use the "&" character in a file name we try to accommodate his/her preference, at least if it is technically feasible.

These issues are "teething problems" related to two new functions that have been recently introduced: a counter of file downloads, not visible yet but running in background, which is supposed to be welcome by contributors who would like to know how many times their editions have been downloaded; and the need of a copyright disclaimer related to the new legal status of CPDL that will be (hopefully) soon announced, and that is aimed at ensuring long term stability and protection for this important initiative, used by so many choirs worldwide. So, thank you again for having provided your valuable feedback.

Max