Problem with new Files Section

This is the place for questions and issues relating to the web site or the forums.

Moderator: Moderators

Mark Pierson
Expert
Posts: 3018
Joined: Sun Aug 03, 2003 12:13 am
Location: Connecticut, USA
Contact:

Problem with new Files Section

Post 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").
Mark
Nils_Ekberg
Expert
Posts: 1689
Joined: Sat Aug 02, 2003 2:08 pm
Location: Near Albany, NY

Post 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.
The Robman
Site Owner
Posts: 21892
Joined: Fri Aug 01, 2003 9:37 am
Location: Chicago, IL
Contact:

Post 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?
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
Mark Pierson
Expert
Posts: 3018
Joined: Sun Aug 03, 2003 12:13 am
Location: Connecticut, USA
Contact:

Post 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"...
Mark
Mark Pierson
Expert
Posts: 3018
Joined: Sun Aug 03, 2003 12:13 am
Location: Connecticut, USA
Contact:

Post 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>.
Mark
The Robman
Site Owner
Posts: 21892
Joined: Fri Aug 01, 2003 9:37 am
Location: Chicago, IL
Contact:

Post 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.
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
Mark Pierson
Expert
Posts: 3018
Joined: Sun Aug 03, 2003 12:13 am
Location: Connecticut, USA
Contact:

Post 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.
Last edited by Mark Pierson on Thu Oct 14, 2004 6:02 pm, edited 1 time in total.
Mark
Mark Pierson
Expert
Posts: 3018
Joined: Sun Aug 03, 2003 12:13 am
Location: Connecticut, USA
Contact:

Post 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?
Mark
mr_d_p_gumby
Expert
Posts: 1370
Joined: Sun Aug 03, 2003 12:13 am
Location: Newbury Park, CA

Post 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).
The Robman
Site Owner
Posts: 21892
Joined: Fri Aug 01, 2003 9:37 am
Location: Chicago, IL
Contact:

Post 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.
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
e34m5
Posts: 675
Joined: Tue Oct 14, 2003 1:04 pm
Location: Atlanta

Post 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.
Paul
pgk
Posts: 113
Joined: Sat Aug 21, 2004 11:53 am
Location: London

Post 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.
pgk
Posts: 113
Joined: Sat Aug 21, 2004 11:53 am
Location: London

Post 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.
Mark Pierson
Expert
Posts: 3018
Joined: Sun Aug 03, 2003 12:13 am
Location: Connecticut, USA
Contact:

Post 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.
Mark
lucindrea
Site Admin
Posts: 37
Joined: Tue Aug 05, 2003 1:12 pm
Location: Philadelphia PA

Post 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.
Post Reply