Page 1 of 2

Problem with new Files Section

Posted: Thu Oct 14, 2004 2:18 pm
by Mark Pierson
I'm not sure whether the problem is on my end or with the new File Section, but here's what I've noticed:

My system is configured to automatically open .txt files in a browser window. This is what prompted me to add the "Import" feature to KM in the first place. However, when I click the Download button on any of the new files, the resulting file is not formatted properly within the resulting browser window. For example, clicking the button yields:

Code: Select all

Name:,Loewe TV,,,,v8.29,,,,,,,CURRENT DATA Devices:,RC-5,0,100,,,,,,,,, Manual:,,0 = 1-byte,LSB-COMP,86,NO,,,,,,, Setup:,1054,99 = URC-6131 PVR,02 - TV,OBC,USE,1F 5F 5F,1,,,,, URC-6131 PVR Device Upgrade Code:,,,,,,,,,,,, 
As you can see, all the line breaks are missing, and this format doesn't work with KM's Import feature. The same file opened from Yahoo yields:

Code: Select all

Name:,Loewe TV,,,,v8.29,,,,,,,CURRENT DATA
Devices:,RC-5,0,100,,,,,,,,,
Manual:,,0 = 1-byte,LSB-COMP,86,NO,,,,,,,
Setup:,1054,99 = URC-6131 PVR,02 - TV,OBC,USE,1F 5F 5F,1,,,,,
URC-6131 PVR Device Upgrade Code:,,,,,,,,,,,,
If I right-click the Download button and select Save Target As..., the contents are correct. This leads me to believe that there's some extra formatting (or lack thereof) occuring by whatever routine is creating the download ("dload.php?action=download&file_id=52").

Posted: Thu Oct 14, 2004 2:33 pm
by Nils_Ekberg
It looks like it is using Mac or Unix line breaks instead of DOS. I think IE only recognizes DOS on a Windows system.

Posted: Thu Oct 14, 2004 2:49 pm
by The Robman
I can't even get it to open the file in a browser window, I always get the "Save" or "Open" pop up. What is the URL of the file when you open it? What setting did you have to change to get the file to open in a window?

Posted: Thu Oct 14, 2004 3:26 pm
by Mark Pierson
The Robman wrote:What is the URL of the file when you open it?
http://www.hifi-remote.com/forums/dload ... file_id=52
What setting did you have to change to get the file to open in a window?
IIRC, isn't there a checkbox in the dialog box that prompts you to Save or Open? Something like "Always use this app to open this type of file"...

Posted: Thu Oct 14, 2004 3:34 pm
by Mark Pierson
Nils_Ekberg wrote:It looks like it is using Mac or Unix line breaks instead of DOS.
As far as I can tell the line breaks are being stripped entirely and are replaced with a <space>.

Posted: Thu Oct 14, 2004 5:21 pm
by The Robman
Mark Pierson wrote:
The Robman wrote:What is the URL of the file when you open it?
http://www.hifi-remote.com/forums/dload ... file_id=52
That link just takes me to the page showing information about the file, so we must be seeing different things.
Mark Pierson wrote:
The Robman wrote:What setting did you have to change to get the file to open in a window?
IIRC, isn't there a checkbox in the dialog box that prompts you to Save or Open? Something like "Always use this app to open this type of file"...
Yeah, but if you "open" the file this way, the file opens in Notepad and it looks perfectly normal. So I guess I'm still not seeing how you're getting to the point where the problem arises.

For me, I click on the link you posted and I see the info page, then I click on the DOWNLOAD button, which brings up the "open or save" pop-up. If I click on OPEN, I get the notepad file which looks correct.

Posted: Thu Oct 14, 2004 5:55 pm
by Mark Pierson
The Robman wrote:That link just takes me to the page showing information about the file, so we must be seeing different things.
I think I pasted the wrong URL before. Try this link: http://www.hifi-remote.com/forums/dload ... file_id=52
For me, I click on the link you posted and I see the info page, then I click on the DOWNLOAD button, which brings up the "open or save" pop-up. If I click on OPEN, I get the notepad file which looks correct.
Naturally, I can't find where IE and/or Windows is set to open a .txt file in a browser window. :?

As I said before, if I right-click the Download button and select Save Target As..., the resulting file opens fine in Notepad. It's only the contents that are displayed within a browser window that are messed up without line breaks.

I'll keep hunting on my end to see if I can figure out how/where IE is hiding that setting.

Posted: Thu Oct 14, 2004 6:00 pm
by Mark Pierson
The Robman wrote:For me, I click on the link you posted and I see the info page, then I click on the DOWNLOAD button, which brings up the "open or save" pop-up. If I click on OPEN, I get the notepad file which looks correct.
What happens when you click on a Yahoo file link?

http://groups.yahoo.com/group/jp1/files ... 35A_TV.txt

Do you still get the Save or Open dialog?

Posted: Thu Oct 14, 2004 6:35 pm
by mr_d_p_gumby
Mark Pierson wrote:I think I pasted the wrong URL before. Try this link: http://www.hifi-remote.com/forums/dload ... file_id=52
I downloaded & saved the file, then looked at it with a hex editor. The file has normal Windows line breaks (i.e., $0D $0A).

Posted: Thu Oct 14, 2004 8:40 pm
by The Robman
Mark Pierson wrote:I think I pasted the wrong URL before.
Try this link: http://www.hifi-remote.com/forums/dload ... file_id=52
That link gives me the OPEN/SAVE pop-up.
Mark Pierson wrote:What happens when you click on a Yahoo file link?
For those, the text file opens in a browser.

Posted: Fri Oct 15, 2004 12:50 pm
by e34m5
I have my system set up to use Textpad. When I click on the URL it opens the file in TP with any problems. I also tried it with Notepad and it worked fine. I'm using XP sp2.

Posted: Fri Oct 15, 2004 1:34 pm
by pgk
I think it a mime content-type problem.

The file section here returns the following in the headers:

Content-Type: application/force-download; name="Loewe_TV.txt"


Yahoo on the other hand I can't easily check (because of the silly sign in system and lynx not support https) but I would guess it would be like

Content-Type: text/plain

No line breaks would tend to imply those browsers not forcing the download are treating it as text/html where cr/lf are ignored.

Posted: Fri Oct 15, 2004 2:00 pm
by pgk
Confirmed yahoo does return

Content-Type: text/plain

So I guess it's a question of it the phpBB extension allows that content type to be returned or not.

Posted: Fri Oct 15, 2004 4:27 pm
by Mark Pierson
pgk wrote:I think it a mime content-type problem.

The file section here returns the following in the headers:

Content-Type: application/force-download; name="Loewe_TV.txt"

...

No line breaks would tend to imply those browsers not forcing the download are treating it as text/html where cr/lf are ignored.
I think you're right on the Mime content problem. However, when I save the resulting web page from my browser, I don't see the "application/force-download", but rather a regular "text/html". Either way, the cr/lf's are being stripped from the content.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0070)http://www.hifi-remote.com/forums/dload ... file_id=52 -->
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2900.2523" name=GENERATOR></HEAD>
<BODY>Name:,Loewe TV,,,,v8.29,,,,,,,CURRENT DATA Devices:,RC-5,0,100,,,,,,,,,
...
</BODY></HTML>
So I guess it's a question of it the phpBB extension allows that content type to be returned or not.
Hopefully, this is the solution and, more importantly, someone can make the necessary changes. While I can live with it as is (knowing the workaround on my end), it would be nice to see it fixed for anyone else who runs into the same problem.

Posted: Sun Oct 17, 2004 6:40 am
by lucindrea
the site uses php .... php , perl , cgi ( just a form of perl ) java , asp , etc .. they will all run into the same problem .. lf/cr in files served on a web server breaks the code used to serve them ( asp on microsofts servers are a little differnt because it does alot of converting on the server end , hence the reasion M$ web servers are so slow ) .. as a built in function most web servers and script compilers strip these breaks when serving the page , this is differnt then when you are downloading where the file is sent as binary and not text ..

this is the reasion you will see ALOT of 12k txt files ziped up ( on other pages , no idea how rob has done it here ) , to basicly force you to download them .. if right clicking and save file as works then do that , also keep in mind that IE doesnt play well with most of the worlds web servers ( mostly unix based ) because M$ is under the misguided inpression that not programing for the "standard" will force companies to use their web server ( it acctully just makes programers life more complex ) , so their is the off chance the IE is mis reading the mime types sent by the server ...
i cannot test this at home because i do not use IE , and i cant do much from work because i really cannot d/l anything to this system

their is also the chance that the line feeds got striped during the ftp trasnfer if they were sent txt and not binary , agin i would need to ask rob how he is sending them .. or if he is useing the on site script to send the files , then the php script may be striping the cr/lf also .. all the more reasion to zip em up.

i'll look into the mime type , but rember the upload/download section is made for files , not text.