JP1 Remotes Forum Index JP1 Remotes


FAQFAQ SearchSearch 7 days of topics7 Days MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

Downloading files issue
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> Web Site Issues
View previous topic :: View next topic  
Author Message
e34m5



Joined: 14 Oct 2003
Posts: 675
Location: Atlanta

                    
PostPosted: Mon Aug 15, 2005 7:34 pm    Post subject: Downloading files issue Reply with quote

I just downloaded this file but KM doesn't like it. Tells me it's not a valid KM file.... Confused
_________________
Paul
Back to top
View user's profile Send private message
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 21237
Location: Chicago, IL

                    
PostPosted: Mon Aug 15, 2005 8:40 pm    Post subject: Reply with quote

I assume you mean this file...
http://www.hifi-remote.com/forums/dload.php?action=file&file_id=114

I just downloaded it and opened it in KM without a problem.

When you downloaded it, did you use the "Save Target As..." option...


_________________
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
Back to top
View user's profile Send private message Visit poster's website
underquark
Expert


Joined: 20 Jun 2005
Posts: 874
Location: UK

                    
PostPosted: Tue Aug 16, 2005 3:00 am    Post subject: Reply with quote

Robman;

As this appears to be a common problem and since you can't guarantee to force your server to download as plain text (since you cant know how everyone's browsers are set up) could you add the advice to "Save Target As..." in the "NOTICE" section of the File area, perhaps?
Back to top
View user's profile Send private message
e34m5



Joined: 14 Oct 2003
Posts: 675
Location: Atlanta

                    
PostPosted: Tue Aug 16, 2005 8:58 pm    Post subject: Reply with quote

I've never done it that way before. I always click on download which opens the file and then do a "save as". I tried it with other files just now and it always works (this file was the exception).

What you are saying is to right click on the download button and then "save target as". That is not a download in the strict sense of the word then.

Not to be contrarian but that is not very intuitive at all. In fact it never ocurred to me since the method I described has always worked for before. This is the first time it hasn't.

I would suggest that if this is the way to do it then the "download" button should not be active and some explanation provided to right click.

Just some thoughts....
_________________
Paul
Back to top
View user's profile Send private message
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 21237
Location: Chicago, IL

                    
PostPosted: Tue Aug 16, 2005 9:54 pm    Post subject: Reply with quote

I agree. If I knew how to change the forum software I would.
_________________
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
Back to top
View user's profile Send private message Visit poster's website
underquark
Expert


Joined: 20 Jun 2005
Posts: 874
Location: UK

                    
PostPosted: Wed Aug 17, 2005 3:48 am    Post subject: Reply with quote

Blame MS for coming up with a "feature" in IE which causes it to try to be too smart and display the plain text in an HTML window. Once the text is wrapped up this way it loses some of its character - the line feed character, I think - and this then screws it up when saved as a text file. KM relies on its files having a strict format with end-of-line characters etc.

The forum software is an off-the-shelf package probably running on a Linux server and used all over the place so the list owner can't change the buttons nor add a comment right next to the Download button. Suggestions have been made to "force" the server to deliver text-only but MS moved the goal-posts in their browser after a nice, stable Linux server set-up was working fine for millions of users.
Back to top
View user's profile Send private message
mtakahar
Expert


Joined: 03 Aug 2003
Posts: 281

                    
PostPosted: Wed Aug 17, 2005 10:19 am    Post subject: Reply with quote

Rob,

Have you tried using application/download as the content type instead of application/force-download?

Hal
Back to top
View user's profile Send private message
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 21237
Location: Chicago, IL

                    
PostPosted: Wed Aug 17, 2005 10:44 am    Post subject: Reply with quote

Are you familiar enough with the forum php code, and the pafiledb mod, that you would know where to make that change? If so, I'm more than willing to give it a try.
_________________
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
Back to top
View user's profile Send private message Visit poster's website
mtakahar
Expert


Joined: 03 Aug 2003
Posts: 281

                    
PostPosted: Wed Aug 17, 2005 11:05 am    Post subject: Reply with quote

Sorry, no, I'm not, however, according to this post, I think you've already had an experience touching the code in this area.

You may also want to try application/octet-stream, plus combinations of those types and with/without the file name in the Content-type header and see which one works the best.

Hal
Back to top
View user's profile Send private message
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 21237
Location: Chicago, IL

                    
PostPosted: Wed Aug 17, 2005 11:32 am    Post subject: Reply with quote

OK, I've found where I could make that change. Before I change it, what is the difference between the two methods?
_________________
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
Back to top
View user's profile Send private message Visit poster's website
gfb107
Expert


Joined: 03 Aug 2003
Posts: 3411
Location: Cary, NC

                    
PostPosted: Wed Aug 17, 2005 11:59 am    Post subject: Reply with quote

I found something that might be helpful: Making IE Accept File Downloads.
_________________
-- Greg
Original RemoteMaster developer
JP1 How-To's and Software Tools
The #1 Code Search FAQ and it's answer (PLEASE READ FIRST)
Back to top
View user's profile Send private message Visit poster's website
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 21237
Location: Chicago, IL

                    
PostPosted: Wed Aug 17, 2005 12:15 pm    Post subject: Reply with quote

The part that caught my eye in that doc is this...
Code:
header('Content-type: application/octet-stream');
header('Content-Disposition: attachment; filename=\"report.csv\"');
print($csv);


I looked in the pa_download.php file that's part of the pafiledb software that I use and I found this...

Code:
//
// Send out the Headers
//
if ($browser_agent == 'ie')
{
    header('Content-Type: ' . $mimetype . '; name="' . $real_filename . '"');
    header('Content-Disposition: inline; filename="' . $real_filename . '"');
}
else
{
    header('Content-Type: ' . $mimetype . '; name="' . $real_filename . '"');
    header('Content-Disposition: attachment; filename="' . $real_filename . '"');
}


So, the page you linked to is using "attachment" as the disposition, whereas my code is deliberately changing it to "inline" just for MSIE, so I have to believe that they did this for a reason.

Also, I can't test the change because the DOWNLOAD button works for me without me needing to use "Save Target As".

Plus, one of the comments on that page is this...
scoutt wrote:
you can get rid of the session_cache_limiter and just change your header to this

header(”Content-disposition: inline; filename=filename=”report.csv”");

notice I changed it to “inline” IE needs that.

_________________
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
Back to top
View user's profile Send private message Visit poster's website
gfb107
Expert


Joined: 03 Aug 2003
Posts: 3411
Location: Cary, NC

                    
PostPosted: Wed Aug 17, 2005 12:36 pm    Post subject: Reply with quote

Well, all I can say is that the "inline" doesn't seem to be working.
I'd suggest making the change and asking Paul to try it. You can always undo it if it doesn't work out.

Note that you may only need to force the change for IE when the mime type is "text/plain".
_________________
-- Greg
Original RemoteMaster developer
JP1 How-To's and Software Tools
The #1 Code Search FAQ and it's answer (PLEASE READ FIRST)
Back to top
View user's profile Send private message Visit poster's website
e34m5



Joined: 14 Oct 2003
Posts: 675
Location: Atlanta

                    
PostPosted: Wed Aug 17, 2005 8:14 pm    Post subject: Reply with quote

Rob:

Don't know if you have made a change but it's still not working. What get's me is why only this file. All others I tried work fine.

Are we sure we can discard that perhaps a change in KM is doing something different when creating a file.

Paul
_________________
Paul
Back to top
View user's profile Send private message
Mark Pierson
Expert


Joined: 03 Aug 2003
Posts: 3017
Location: Connecticut, USA

                    
PostPosted: Wed Aug 17, 2005 8:37 pm    Post subject: Reply with quote

e34m5 wrote:
Are we sure we can discard that perhaps a change in KM is doing something different when creating a file.
Nothing's changed in the KM file format or SAVE routines. In fact, I added some format checking in v8.32 to try and accomodate this anomaly.

It has something to do with the way the forum software presents the .txt format to IE, possibly the way Greg described above.

I don't remember the specifics, but back when this problem first surfaced, I know the mime type from the file section here was different than that from Yahoo. The basic reason it causes KM to choke is that line feeds get stripped from the text file.
_________________
Mark
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> Web Site Issues All times are GMT - 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

Powered by phpBB © 2001, 2005 phpBB Group
Top 7 Advantages of Playing Online Slots The Evolution of Remote Control