Log in

View Full Version : Pocket Internet Explorer and Downloads


Jason Dunn
12-28-2002, 09:18 PM
Just when I think I can't possibly dislike Pocket Internet Explorer any more, some new fault crops up that makes me think "What on earth were they thinking when they designed this?" :evil:. Case in point: I created <a href="http://www.pocketpcthoughts.com/files/ppcthoughts-simplepda.lit">a Microsoft Reader-formatted eBook</a> of Ed's long column, because I thought it would make for good reading on a Pocket PC (and hey, you can keep it on your device and show it to people when they say Palm is "simpler" than a Pocket PC). I then hit the mobile site on my XDA to download the book - because what can be cooler than downloading an eBook over the air onto your device, right? Well, apparently someone at Microsoft doesn't agree with me - go ahead, hit the mobile site and tap on the link. What happens? It downloads the file all right, but as raw code, not a LIT file. The same thing happens with Today themes - raw code, no download.<br /><br />Someone correct me if I'm wrong, but I think this is because Pocket Internet Explorer doesn't have LIT and TSK as supported MIME file types - and since it doesn't know what to do with them as a file type, it downloads the files as raw code. Complete lack of intelligence, and we're not talking about some esoteric file format here - LIT and TSK are Pocket PC native file formats with applications that use them.<br /><br />So, Microsoft, what are you thinking?<br /><br /><b>UPDATE:</b> Uh, it would seem that this issue is tied to the MIME types setting on my server, which just might make my entire point moot. :oops: Still, I have to wonder why Pocket Internet Explorer doesn't deal with unknown MIME types like Internet Explorer does. If it's an unknown MIME type, it simply downloads the file. That makes more sense doesn't it?

Ken Mattern
12-28-2002, 09:37 PM
Jason,

You should have no trouble downloading a .LIT file and opening it. I do that all the time when I demo my eBook site. Maybe you have a bum setting somewhere.

Ken

Green Dragon
12-28-2002, 09:40 PM
What's your server setting the mime type to for those files? I'm not aware of a ".lit" specific mime type. A lot of servers will send unknown file types as "text/plain". Try setting it to serve .lit and .tsk as "application/octet-stream" instead. That should make it clear to the browser that it's to be saved. Hope that works.

Green Dragon
12-28-2002, 09:54 PM
Just checked and you are serving the .lit file as text/plain. Try the link in the article with a browser like Mozilla. It appears as raw text. This happens as Mozilla, for better or worse, is standards compliant and observes the mime type the server sends. It looks like PIE may well behave the same way.

For some reason the full desktop version of IE goes and merrily ignores mime types and works on the file extention :x. As a web developer it's been a bugbear for quite a while...

The upshot is the link works on desktop IE as is, because it works by file extentions. Fix the mime type the server's sending and it should work in all browsers too. Including pocket IE :D.

Shaun Stuart
12-28-2002, 10:26 PM
Nice ebook - I did not know that mocrosoft ebooks allowed pictures - what did you use to create it ?

Janak Parekh
12-28-2002, 10:43 PM
For some reason the full desktop version of IE goes and merrily ignores mime types and works on the file extention :x. As a web developer it's been a bugbear for quite a while...
Yup, even worse is the fact that this can lead to some interesting vulnerabilities. For example, with older versions of IE, you could send an .exe (or something like it) as a text/plain, and it wouldn't warn you about binary code being downloaded, but IE could still run the program if you chose to "open" it.

--janak

bdeli
12-28-2002, 10:55 PM
Nice ebook - I did not know that mocrosoft ebooks allowed pictures - what did you use to create it ?

You can create ebooks with the free Microsoft Reader Word 2000/2002 Add-in. http://office.microsoft.com/downloads/2002/wdReader.aspx

pt
12-28-2002, 11:05 PM
the mime type(s) may need to be added to your server, or there's some odd server settings. it's not the device as far as i can tell...

try this as an experiment.

1. make a html page and link to a .lit file.
2. place *both* files on the device.
3. tap the link, you'll see the the .lit file opens fine from the html page.

lemme know.

cheers,
pt

KyleC
12-28-2002, 11:45 PM
The irony is just sickening that after all your trouble, the article you were trying to make easyier to read and take on the go to show others was a document complaining that people unfairly judged the Pocket PC as "too complex". I think that they might start making surgeon general warning labels on Pocket PC boxes and ads that say something like "The surgeon general has determined that Pocket PCs are a major contributor to high blood pressure" :wink:

Janak Parekh
12-28-2002, 11:52 PM
The irony is just sickening that after all your trouble, the article you were trying to make easyier to read and take on the go to show others was a document complaining that people unfairly judged the Pocket PC as "too complex".
Well, that's the thing about this site. Jason is lambasted for being an MS apologist, but he does rant on them whenever appropriate. :)

As the irony between the two posts, there might be an implied irony, but it really isn't. Ed was comparing PDA tasks. The Pocket PC can get quite complex, but his assertion was that the comparisons Palm makes (i.e., daily PDA organizer-style usage) are not valid.

--janak

TrojanUO
12-29-2002, 01:39 AM
The irony is just sickening that after all your trouble, the article you were trying to make easyier to read and take on the go to show others was a document complaining that people unfairly judged the Pocket PC as "too complex". I think that they might start making surgeon general warning labels on Pocket PC boxes and ads that say something like "The surgeon general has determined that Pocket PCs are a major contributor to high blood pressure" :wink:

That might be accurate if the problem was actually on the PocketPC, but as has been demonstrated above, it appears to be an error on the Server End, not the PocketPC.

sponge
12-29-2002, 04:02 AM
And it was seen as a problem, due to MS' not staying true to standards again :P

(Sorry, couldn't resist the jab)

Jason Dunn
12-29-2002, 04:19 AM
Nice ebook - I did not know that mocrosoft ebooks allowed pictures - what did you use to create it ?

I used the ultra-basic Microsoft Word Reader add-in: copy, paste, eBook. :-) It's a very crude tool, but it did the job.

Janak Parekh
12-29-2002, 04:27 AM
Re your update, Jason...

UPDATE: Uh, it would seem that this issue is tied to the MIME types setting on my server, which just might make my entire point moot. icon_redface.gif Still, I have to wonder why Pocket Internet Explorer doesn't deal with unknown MIME types like Internet Explorer does. If it's an unknown MIME type, it simply downloads the file. That makes more sense doesn't it?
Actually, the server is reporting a known type when I ask it for the ebook:

HTTP/1.1 200 OK
Date: Sun, 29 Dec 2002 03:26:04 GMT
Server: Apache/1.3.22 (Unix) (Red-Hat/Linux) mod_jk/1.2.0 mod_perl/1.24_01 PHP/4.1.1 FrontPage/5.0.2 mod_ssl/2.8.5 OpenSSL/0.9.6b
Last-Modified: Sat, 28 Dec 2002 17:51:56 GMT
ETag: "3aa3b7-4f49d-3e0de4bc"
Accept-Ranges: bytes
Content-Length: 324765
Connection: close
Content-Type: text/plain

Note the last line -- the server is telling the browser "I'm serving plaintext content". IE on the desktop is actually broken in that it will interpret the extension even if the server is telling it otherwise. :)

--janak

Janak Parekh
12-29-2002, 04:29 AM
And it was seen as a problem, due to MS' not staying true to standards again :P

(Sorry, couldn't resist the jab)
The funny thing is, Pocket IE is standards-compliant here. :)

I don't think MS is deliberately trying to break stuff on the desktop - it was implemented wrong, and now they have a whole set of dependencies on the assumption that IE determines MIME types by extension. Not so easy to change if one, as Windows does, relies on IE as a renderer for internal OS stuff.

--janak

Jason Dunn
12-29-2002, 04:30 AM
Just checked and you are serving the .lit file as text/plain. Try the link in the article with a browser like Mozilla. It appears as raw text. This happens as Mozilla, for better or worse, is standards compliant and observes the mime type the server sends. It looks like PIE may well behave the same way.

Yup, that appears to be the problem. I've been a "webmaster" for nearly a decade now, and obviously not a very good one - I've never edited a server-side MIME type file. The ensim control interface on the Rackshack server doesn't even have a tool for doing this - I need to hack some file from a command shell...not very intuitive. And every Web server in the world needs to have this file set up...manually? Doesn't strike me as being very efficient. :? Or maybe I'm just feeling stupid that it's a problem with the server... :wink: :lol:

For some reason the full desktop version of IE goes and merrily ignores mime types and works on the file extention :x. As a web developer it's been a bugbear for quite a while...

To me at least, that makes a lot of sense. The Web server shouldn't care what it's serving up - the client should handle it. Having an endless patch cycle on every server every time there's a new file format doesn't make any sense to me. I wish Pocket Internet Explorer was as "non-compliant" as it's big brother on the desktop - it would make our lives a lot easier. :lol:

Jason Dunn
12-29-2002, 04:32 AM
HTTP/1.1 200 OK
Date: Sun, 29 Dec 2002 03:26:04 GMT
Server: Apache/1.3.22 (Unix) (Red-Hat/Linux) mod_jk/1.2.0 mod_perl/1.24_01 PHP/4.1.1 FrontPage/5.0.2 mod_ssl/2.8.5 OpenSSL/0.9.6b
Last-Modified: Sat, 28 Dec 2002 17:51:56 GMT
ETag: "3aa3b7-4f49d-3e0de4bc"
Accept-Ranges: bytes
Content-Length: 324765
Connection: close
Content-Type: text/plain

Note the last line -- the server is telling the browser "I'm serving plaintext content".

But it's not plain text content - it's a binary file that needs to stay intact... :?

Janak Parekh
12-29-2002, 04:34 AM
Yup, that appears to be the problem. I've been a "webmaster" for nearly a decade now, and obviously not a very good one - I've never edited a server-side MIME type file.
Hey, this doesn't mean you're a bad webmaster -- you've just never had to do it, as the server's defaults have been sufficient. :)

I need to hack some file from a command shell...not very intuitive.
You can blame Apache for that. There are GUI tools, but no standard.

To me at least, that makes a lot of sense. The Web server shouldn't care what it's serving up - the client should handle it.
The problem with asking the client to know is what if it doesn't know what a LIT file is? In theory, the server, since it's serving the content, should be telling the client "I'm about to send you down a binary file, treat it as such". :)

In theory, some very smart guys invented HTTP. In practice, it's always a lot more complicated than you'd like.

--janak

JonnoB
12-29-2002, 06:47 AM
The http protocol only sends text... period. MIME is an encoding format that turns binary data into text that can then be re-encoded on the client. The MIME declaration is the server indicating that the file is of a certain type. The client never recieved binary, only a file with the extension .lit and a bunch of text. The client needs to know how to re-encode the file.

The good thing about IE on the desktop is that it will guess first from the file-extension and then the MIME binary type. PIE does not due this. Remember, not all OS have file extensions, so to assume an extension defines the file type is wrong. I could for example, create a text file called document.literature Using the Windows based file extension, this would look like document.lit which IE would assume with a .lit file when really it was a text file.... and my server delivered it as text/plain and was correct.

Now... this said, MS could have done a better job, and do as was done in IE by making assumptions on some standard file formats. Also, IE allows you do download a file regardless of type by right-clicking on the link. PIE offers no such feature. If they allowed this, then you could mannaully download the file.

Daniel
12-30-2002, 12:52 AM
Oh, yeah, PIE does suck a lot Jason, just maybe not in this particular case. :)

Daniel

Pony99CA
12-30-2002, 01:47 AM
Just checked and you are serving the .lit file as text/plain. Try the link in the article with a browser like Mozilla. It appears as raw text. This happens as Mozilla, for better or worse, is standards compliant and observes the mime type the server sends. It looks like PIE may well behave the same way.

How do I change the MIME types? Is there some HTML code I can use to do that?

I don't run my own server, and the eBooks on my site (http://www.garlic.com/~svvg/svvgppc.html#EBOOKS) get served as text. You have to use Save Link Target As in Mozilla to get them in .lit format. :-(

Steve

Pony99CA
12-30-2002, 01:47 AM
Nice ebook - I did not know that mocrosoft ebooks allowed pictures - what did you use to create it ?
To create eBooks for free, you can look at eBookExpress (http://www.ebookexpress.com). I used it to create the eBooks on my site (http://www.garlic.com/~svvg/svvgppc.html#EBOOKS).

Steve

Pony99CA
12-30-2002, 01:49 AM
Now... this said, MS could have done a better job, and do as was done in IE by making assumptions on some standard file formats. Also, IE allows you do download a file regardless of type by right-clicking on the link. PIE offers no such feature. If they allowed this, then you could mannaully download the file.
Sadly, neither Pocket IE nor MultiIE seem to allow a Save Link Target As function like Mozilla or most browsers do.

Steve

Janak Parekh
12-30-2002, 03:53 AM
How do I change the MIME types? Is there some HTML code I can use to do that?
Hmm, it seems like you're using apache:
HTTP/1.1 200 OK
Date: Mon, 30 Dec 2002 03:01:34 GMT
Server: Apache/1.3.26 (Unix) PHP/4.2.3
X-Powered-By: PHP/4.2.3
Connection: close
Content-Type: text/html
You might be able to put mod_mime commands into an .htaccess file in the appropriate directory. See http://httpd.apache.org/docs/mod/mod_mime.html -- maybe some of the directives will work. No guarantees though, it depends on whether the admin gave you the right to set up .htaccess files and what they can contain. I've also never tried to set up handlers inside an .htaccess file.

Typically, you edit /etc/mime.types and add the appropriate extensions.

Update: Seems like I'm on the right track here-- see the bottom of http://www.bignosebird.com/apache/a1.shtml

Sadly, neither Pocket IE nor MultiIE seem to allow a Save Link Target As function like Mozilla or most browsers do.
Now this is an outright stupidity, eh? :)

--janak

Bajan Cherry
12-30-2002, 07:34 AM
Following article may help throw some light into the matter:
http://www.microsoft.com/mobile/developer/technicalarticles/pieapplaunch.asp

I recommend bundling the eBook into cab file, which Pie will execute as soon as the download gets over. The cab instructions will do the job of copying the eBook on the device.

Pony99CA
12-30-2002, 08:57 AM
How do I change the MIME types? Is there some HTML code I can use to do that?
Hmm, it seems like you're using apache:
HTTP/1.1 200 OK
Date: Mon, 30 Dec 2002 03:01:34 GMT
Server: Apache/1.3.26 (Unix) PHP/4.2.3
X-Powered-By: PHP/4.2.3
Connection: close
Content-Type: text/html
You might be able to put mod_mime commands into an .htaccess file in the appropriate directory. See http://httpd.apache.org/docs/mod/mod_mime.html -- maybe some of the directives will work. No guarantees though, it depends on whether the admin gave you the right to set up .htaccess files and what they can contain. I've also never tried to set up handlers inside an .htaccess file.

Typically, you edit /etc/mime.types and add the appropriate extensions.

Update: Seems like I'm on the right track here-- see the bottom of http://www.bignosebird.com/apache/a1.shtml

Thanks for the info. As I don't run the server, I didn't try to use mime.types. Instead, I created a .htaccess file on my Web site's main directory containing the following:


AddType application/octet-stream .lit

That seems to have worked. I now get the Open/Save dialog in Mozilla. The strange thing is, if I select Open, the file downloads and MS Reader starts, but it closes right away. If I double-click on the .lit file in the \Windows\Temp directory, the file opens just fine.

If I visit the eBook section of my site (http://www.garlic.com/~svvg/svvgppc.html#EBOOKS) using Pocket IE, when I select one of the eBooks, I get the Download dialog and the file opens just fine if the Open box is checked. Try it and see.

So if Jason tries the above (as he seems to be using Apache), .lit files on Pocket PC Thoughts should open in Pocket IE just fine. He hasn't fixed it yet, though -- the eBook (http://www.pocketpcthoughts.com/files/ppcthoughts-simplepda.lit) still downloads as text.

Steve

Pony99CA
12-30-2002, 09:47 AM
Following article may help throw some light into the matter:
http://www.microsoft.com/mobile/developer/technicalarticles/pieapplaunch.asp

I recommend bundling the eBook into cab file, which Pie will execute as soon as the download gets over. The cab instructions will do the job of copying the eBook on the device.
I read that article, and I'm not sure how it helps. When trying to decide what to do, the article says Pocket IE follows the following steps:


1. Pocket Internet Explorer checks the MIME type. If it recognizes the type, then it starts the correct application and redirects the url to the application.

2. If Pocket Internet Explorer cannot identify the MIME type, it downloads the file and scans it to check whether the file contains any HTML. If it finds HTML, it displays the file. This can actually lead to some problems with binary files that have an HTML section somewhere inside.

3. If Pocket Internet Explorer does not find any HTML, it passes the file name, including its directory path, to the ShellExecute() function. From that point, ShellExecute() has to deal with the file. If the extension is associated with an application in the registry, then ShellExecute() will execute the “open” command in the registry association setting.

In Jason's case, I think step #1 succeeded as the MIME type was set to text. Therefore, MS Reader would never launch.

Even if it reached step #3, I don't think packaging the eBook in a CAB file would help. The article described two methods to launch applications when a link pointing to a data file was clicked.

The first method just deals with downloading an application and ensuring the appropriate registry keys are set. For .lit files, the registry already has keys in HKEY_CLASSES_ROOT to support eBooks, although different than the article suggests -- .lit has a Content Type key with a value of application/x-msebook, and there is no litfile section (but there is an eBook section).

The second method requires another file extension for pseudo-streaming, but I didn't quite follow how that would work.

Am I missing something?

Steve

Janak Parekh
12-30-2002, 04:28 PM
Even if it reached step #3, I don't think packaging the eBook in a CAB file would help. The article described two methods to launch applications when a link pointing to a data file was clicked.
It might, but it's not a permanent solution. The idea here is the .cab file would cause a shell execution, and at that point processing the embedded content would be out of PIE's hands and in the hands of the shell, which would go by the extension type and not the MIME type of the embedded data.

As to this site, we're working on fixing the problem. :)

--janak

Pony99CA
12-31-2002, 08:23 AM
As to this site, we're working on fixing the problem. :)

Out of curiosity, is it really that hard? What you suggested to me worked, and I got it working in 20 minutes (and I'm no Web guru).

I realize Pocket PC Thoughts is much bigger and much more complicated than my puny site :-) so I'm curious why changing the mime.types or .htaccess file won't work. Or will it?

I've already learned some useful things in this thread, and I'm trying to learn more. :-)

Steve

Janak Parekh
12-31-2002, 05:18 PM
I realize Pocket PC Thoughts is much bigger and much more complicated than my puny site :-) so I'm curious why changing the mime.types or .htaccess file won't work. Or will it?
It will work just fine -- it's just not #1 on the list of things to be done right now. Preparing for tomorrow's big event, on the other hand, is. ;)

--janak