Log in

View Full Version : Downloading binary files off the Web on the Pocket PC - tips and tricks


Menneisyys
07-28-2005, 10:05 AM
Downloading binary files off the Web on the Pocket PC - tips and tricks (and saving HTML pages that would otherwise not be savable)

Unfortunately, binary files in Pocket PC browsers (there’re no exceptions!) are treated as textual files and are always rendered so, unlike in their desktop cousins, which download them at once as binary content. This means a PPC Web browser will always try to render a, say, CAB file instead of downloading it as a binary file (thi is one of the reasons of why many PPC developers put their CAB’s in ZIP files – ZIP files are saved by the browsers). This makes it almost impossible to easily save files.

There’re, naturally, ways of combatting this. Under Pocket Internet Explorer (PIE) (if you don’t use the MultiIE plug-in), for example, you only need to go to the cache (\Windows\Profiles\guest\Temporary Internet Files\Content.IE5\ on WM2003+ devices) and look for the file yourself in all of the subdirectories. As there’s no central index file, you’ll need to use, for example, Total Commander (TC) (http://pocketpcmag.com/forum/topic.asp?TOPIC_ID=16568) to look for the binary files you’ve downloaded. For example, let’s assume you’ve clicked a ScreenLock.cab file in some Web page. Then, just navigate to \Windows\Profiles\guest\Temporary Internet Files\Content.IE5\ with TC, choose File/Find Files and enter ScreenLock*.cab in the upper textfield:

http://www.winmobiletech.com/072005SaveLinksInPPCBrowsers/FindFilesInPIECacheWithTC.gif.png

Note the asterisk (*) at the end of the name. It’s needed because it’s by using indices that the PIE cache is separating files of the same name from each other. Most likely, your file will have an index [1] , but it’s better to make a more generic search.

Please note that you can’t just make PIE render a (binary) page and, then, just choose “Save page” feature of Spb Pocket Plus (SPP) . SPP will present the menu item to do so, but this feature won’t start.

This (let PIE render the binary resource and choose Save Web Page As from the menu in the page) works, however, with MultiIE. Don’t be afraid of the .html extension of the file MultiIE creates – it will work because, as always, it’s just a direct copy from the PIE cache.

Unfortunately, with the other browsers, this isn’t possible: ThunderHawk (TH) doesn’t cache at all and, much as NetFront (NF) does, it also includes the HTTP response headers in even binary response files in its cache. You would need to strip them first in order to get a 100% original file. (Note that I’m referring to the latest versions.)

As has already been pointed out, the PIE-based page saving in SPP and MultiIE always retrieves files from the PIE cache. This is the reason for why PIE plug-ins with page saving capabilities (SPP, MultiIE) fail at saving pages like those of the Brighthand, AximSite, iPAQ HQ and (most of) PPCT forums (FirstLoox and PPCMagazine works). These pages are stored in a non-human-readable, compressed form form in the PIE cache. (Just give it a try if you don’t believe me: try to save any BrightHand (AximSite etc) forum page and check whether you can actually read the saved page). This is why not even MultiIE will be able to retrieve these pages. If we had something like “Save target as”, these pages could be also saved, even on PIE.

In this respect, NF is certainly better. Much as you can’t explicitly save files/pages in NF, its cache (it’s located in the cache subdirectory in the NF home, unless you configure it otherwise) is pretty easy to browse even without Tocal Commander and will always contain HTML files in a human-readable form.

Instead of using the original filenames, the cache has an index file, cache.fat, with both the source URL and the cache file it refers to. What is more important, as has been stated, the HTML pages that PIE fails at saving in textual format are all there in a human-readable form. With HTML pages (unlike with the case of binary files), the additional HTTP response headers won’t cause problems either.

So, we have two problems: a generic problem (the inability to save anything binary easily) and the compression problem of the PIE cache. What should we use in this situation? Of course, direct link saving as in the “Save Target As” in desktop browsers.

Of the many PPC-based PIE plug-in/standalone browser programs, it’s only ftxPBrowser that is able to directly save the contents of a link (like the above-mentioned “Save Target As” option in Internet Explorer). This works great with URL’s that have no question marks in them – that is, URL’s that pass no GET parameters at all to the server:

http://www.winmobiletech.com/072005SaveLinksInPPCBrowsers/ftxPBrowserSavingHTMLPages-2.gif.png

Otherwise, the standard system-level Save Dialog will add the file an extension containing the question mark: it thinks it is its type and doesn’t let the user change it:

http://www.winmobiletech.com/072005SaveLinksInPPCBrowsers/ftxPBrowserSavingHTMLPages-1.gif.png

, which prohibits the file to be written to the file system (you can’t create any file in a Windows file system that has a ? or a * wildcards in them). Unfortunately, changing the Save Dialog to that of Mad Programmer (http://www.pocketpcthoughts.com/forums/viewtopic.php?p=356534) won’t help either. Much as you can now change the name and, therefore, seemingly eliminate the :

http://www.winmobiletech.com/072005SaveLinksInPPCBrowsers/ftxPBrowserSavingHTMLPages-3.gif.png

Unfortunately, this means it’s entirely impossible to save any pages that have URL’s containing additional GET parameters (that is, containing a question mark).

VITO MobileDownloader 2.2 (http://vitotechnology.com/en/products/mobiledownloader.html) to the rescue! I’ve tested this on both platform versions and it, some smaller problems (“can’t connect” error messages now and then) aside, worked flawlessly. It saved everything I’ve thrown it at. Also, it integrates well into the PIE (but not in NF/TH!) link context menu, as a new “Mobile Download” command. (Note that it doesn’t integrate in NF or TH!)

The only problem with VITO MobileDownloader 2.2 is that the context menus (even those of non-links, that is, the ones that have nothing to do with VITO MobileDownloader) after installation become small on SE VGA devices. This is a minor annoyance, though, and is really dwarfed by the ability to save both HTML pages that have been previously been impossible to save with PIE and binary content without the need for some manual hacking or using MultiIE.

(I had problems at first when installing the program on my WM2003SE PL720 which already had an additional connection group with a single BT connection in it. It wouldn’t connect – neither through the AS Internet pass-through nor the active BT GPRS DUN connection. After a hard reset and not restoring anything, it worked OK via the AS Internet pass-through and the newly-created GPRS DUN connection).

Menneisyys
01-22-2006, 08:43 PM
I've just published a benchmark of file download efficiency/speed of all the download-capable Pocket PC browsers/add-ons, including the beta version of Opera, NetFront 3.3 TP 1.03, PIE and the two additional PIE-based download-enablers, ViTO Downloader and ftpxPBrowser. As it is shown, PPC browsers have tremendously different download speeds/efficiency when it comes to download files to the storage card. The article is really worth reading if you often download files with Pocket PC-based browsers using high-speed connections and wondered whether you can speed up the downloading process.

Please see http://www.pocketpcmag.com/blogs/index.php?blog=3&p=466&more=1 for more info.