View previous topic :: View next topic |
Author |
Message |
e34m5
Joined: 14 Oct 2003 Posts: 675 Location: Atlanta |
Posted: Mon Aug 15, 2005 7:34 pm Post subject: Downloading files issue |
|
|
I just downloaded this file but KM doesn't like it. Tells me it's not a valid KM file.... _________________ Paul |
|
Back to top |
|
|
The Robman Site Owner
Joined: 01 Aug 2003 Posts: 21237 Location: Chicago, IL |
|
Back to top |
|
|
underquark Expert
Joined: 20 Jun 2005 Posts: 874 Location: UK |
Posted: Tue Aug 16, 2005 3:00 am Post subject: |
|
|
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 |
|
|
e34m5
Joined: 14 Oct 2003 Posts: 675 Location: Atlanta |
Posted: Tue Aug 16, 2005 8:58 pm Post subject: |
|
|
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 |
|
|
The Robman Site Owner
Joined: 01 Aug 2003 Posts: 21237 Location: Chicago, IL |
Posted: Tue Aug 16, 2005 9:54 pm Post subject: |
|
|
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 |
|
|
underquark Expert
Joined: 20 Jun 2005 Posts: 874 Location: UK |
Posted: Wed Aug 17, 2005 3:48 am Post subject: |
|
|
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 |
|
|
mtakahar Expert
Joined: 03 Aug 2003 Posts: 281
|
Posted: Wed Aug 17, 2005 10:19 am Post subject: |
|
|
Rob,
Have you tried using application/download as the content type instead of application/force-download?
Hal |
|
Back to top |
|
|
The Robman Site Owner
Joined: 01 Aug 2003 Posts: 21237 Location: Chicago, IL |
Posted: Wed Aug 17, 2005 10:44 am Post subject: |
|
|
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 |
|
|
mtakahar Expert
Joined: 03 Aug 2003 Posts: 281
|
Posted: Wed Aug 17, 2005 11:05 am Post subject: |
|
|
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 |
|
|
The Robman Site Owner
Joined: 01 Aug 2003 Posts: 21237 Location: Chicago, IL |
Posted: Wed Aug 17, 2005 11:32 am Post subject: |
|
|
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 |
|
|
gfb107 Expert
Joined: 03 Aug 2003 Posts: 3411 Location: Cary, NC |
|
Back to top |
|
|
The Robman Site Owner
Joined: 01 Aug 2003 Posts: 21237 Location: Chicago, IL |
Posted: Wed Aug 17, 2005 12:15 pm Post subject: |
|
|
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 |
|
|
gfb107 Expert
Joined: 03 Aug 2003 Posts: 3411 Location: Cary, NC |
|
Back to top |
|
|
e34m5
Joined: 14 Oct 2003 Posts: 675 Location: Atlanta |
Posted: Wed Aug 17, 2005 8:14 pm Post subject: |
|
|
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 |
|
|
Mark Pierson Expert
Joined: 03 Aug 2003 Posts: 3017 Location: Connecticut, USA |
Posted: Wed Aug 17, 2005 8:37 pm Post subject: |
|
|
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 |
|
|
|