text file problem

text file problem

by Richard Treves -
Number of replies: 4

I have a text file (*.txt) I tried to upload, it carrys data for a .swf file.  Problem is that its content gets stripped out on upload, it ends up as just being "ÿþ&"

The file is called 'quiz_data.txt' - have I used some sort of illegal characters or keyword?

I'm still on 1.2

Richard

Average of ratings: -
In reply to Richard Treves

Re: text file problem

by Richard Treves -

well I seem to have solved the problem for the time being.  I don't think it was anything to do with the file, it was moodle's file system.  I regularly wipe a number of files out, upload a zip and unzip the same updated files in much the same folders.  Every so often moodle seems to have not wiped the old file because opening what should be the new file actually opens the old file.  The workaround is to put the root in a slightly different place and then the 'old' file is lost and moodle finds the new file.

Is this something that is known about?  Has it been sorted in 1.3? It seems very wierd.

Richard

In reply to Richard Treves

Re: text file problem

by Zbigniew Fiedorowicz -
It could be due to files being cached by your browser on your desktop computer.
In reply to Zbigniew Fiedorowicz

Re: text file problem

by Frederic Triquet -
Hi,

there is an other problem (bug # 1213) when viewing an uploaded file.
When a text file ( .txt ) contains something that looks like an html tag ( "greater than" + "something" + "less than" ), the display of the file is corrupted because moodle (via file.php) sets mime-type of the file to "text/html" (instead of "text/plain") and the web-browser tries to interpret the text as an html tag.

For instance, maths and code may be altered:

---- file begin here ----
the following line will not be correctly displayed by the "file.php" script
if (a<HR) printf("HR>a");
but it draws a "horizontal rule"
---- file ends here ----

In reply to Frederic Triquet

Re: text file problem

by Richard Treves -

Hi Zig and Frederic,

Thanks for your replies.  I suspect Frederic's problem is the source - the file had '=' in it all over the place.  I'll have a look.

Thanks again for your help

Richard