Possible to use "Save" method in a local .htm file to save XML updates? - General Questions and Answers

I am researching the possibility of using MSXML to update XML records on Windows CE devices using only pocket internet explorer. I was able to open and edit XML files using a local web page, but could not successfully save the results of an update. I tried the "save" method of a ActiveXObject("Microsoft.XMLDom") object. This works fine on a PC as long as I save the webpage with the .hta extension, but results in a Permission Denied error when I save the web page with the .htm/.html extension. Win CE doesn't seem to support the .hta extension.
The two biggest restrictions for my project are:
1) Cannot "install" software (.cab,.exe) on the devices due to security policy and
2) There is no data connectivity on the devices.
So my questions are, "Is it possible to save a file using javascript inside a local web page on a Win CE/Windows Mobile device? If so, how?" The file happens to be XML, but the solution need not involve only XML objects as I can readily access the content as plain text.
My best guess is that it is not possible without some sort of windows CE equivalent of the pc .hta file. Anyone? I appreciate any hints/comments that can help.
Thanks,
Dan

Related

View WM5 Registry on my PC

I have made a backup of my HTC Wizard registry and I would like to view and print it out from my PC. Does anyone know of an application that would allow me to do that?
Use S-K Tools SSnap Utility.
Just copy it to your PPC and run it. Unselect all the non registry stuff and let it roll.
It will put a .snp (just a plain text file) file in the root of your device. Take that over to the PC and open it in your favorite text editor.
Or, you can jump over to PPC6700Users and grab either the Sprint or Verizon Virgin Registry from the appropriate sticky.
reddog: just open it in Notepad.
To view a live registry, use the remote tools that come with EVC or Visual Studio 2005. But for viewing an exported registry, just notepad. Don't double click on it or you'll have a very weird PC :shock:.
V
Thanks for the info folks I will try that.
You can use Registry Workshop. This small tool will let you edit your PPC registry from your PC.
More info: http://www.torchsoft.com/

Hyperlink code to force ftp download

What is the proper format for html hyperlink code that will cause a file to download to the phone and not have the browser try to open it? I have files that are text, they are GPS files, but they don't have a TXT extension and IE keeps opening the files as text.
If it matters (but I don't think so) I'm running a reasonably stock HTC WM 6.0 ROM on a Hermes.
Regards,
GPSGary
You want to do this server-side? Or client-side?
FTP download code
I'm trying to write html code that will cause a file on my web site to download directly to the phone file directory without the browser trying to open it. It would be extra useful if I could make it download to a specific existing directory.
Regards,
GPSGary
Well, I hate to say this but you can't. That's the simple answer.
The complicated answer is that you need to set up some sort of server-side script to place the headers manually, or you need to modify some of the settings for your server's remote access handler. On Apache servers, this can be done via a file called .htaccess.
If you have a .htaccess file that you can modify, just enter this at the top of it:
Code:
RewriteEngine on
RewriteCond %{REQUEST_URI} \.(gps|cab)$
RewriteRule .* - [T=application/octet-stream,L]
Note that I didn't know the extension you're talking about so I put "gps" up there. I also added "cab" because many servers have a tendency to not send the proper headers for cab files. Feel free to add other extensions using this same method.
Again, this is assuming you have an Apache server, and you have the privileges to modify a .htaccess file.
Forcing ftp type download
No Apache server so isn't there some other way?
Anyone got a good Java script?
Regards,
GPSGary
Hi there,
as far as I know, you don't need java:
ftp-links are always proposed to "Save File", so your link should be ftp://www.domain.com/folder/filename.txt
This will cause any browser to download the file instead of opening it.
In that case, you definitely need an real ftp access to your file ... (ftp = FIleTransferProtocol).
Best regards,
I've encountered this before and resorted to zipping the file. You can also spoof the system by renaming the file to *.AAA The user, of course, will have to rename the file on their end. I have better luck with .zip unless it's for my own use. Any file which is recognized natively by the browser will open within the browser. This includes .txt, .htm, .html, and any other file associations you've successfully loaded.
gepp said:
No Apache server so isn't there some other way?
Anyone got a good Java script?
Regards,
GPSGary
Click to expand...
Click to collapse
That's what I'm tellin' ya. It's IMPOSSIBLE to do this with client-side scripting, i.e., Javascript.
I'd like to help you get this resolved. Can you clarify some things for me?
Are you using Geocities, Fortunecity, Google Pages, or one of the other free site services out there?
Do you understand the distinction I'm making between client-side and server-side scripting?
What server software are you using, if not Apache?
Are you able to utilize a PHP or Perl engine? (I can tell you how to send the file headers manually through either of those.)
I promise I'm not trying to be rude or anything. I just want to make sure we're both on the same page here. I can tell you the best way of getting this resolved, but I need to know where you stand, and I need to know the extent of your web development knowledge.
PHP or Perl will work
I'm on a Yahoo small business server. I've used PHP so that will work on my site and I know enough to fiddle with it if need be. Less proficient with Perl but have some exposure.
Regards,
GPSGary
Awesome. That works. Here is what you will basically be doing with PHP then.
PHP:
ob_start()
$GPSFile = '/path/to/file.gps'; //This is where the file is located on your Yahoo Business server
$DownloadName = "File.gps"; //This is the name that pops up when you're prompted to download the file (it can be different than the name above).
$TypeOfFile = 'text/plain'; //If you still have issues, change this to 'application/octet-stream'
header("Cache-Control: public, must-revalidate");
header("Pragma: hack");
header("Content-Type: " . $TypeOfFile);
header("Content-Length: " .(string)(filesize($GPSFile)) );
header('Content-Disposition: attachment; filename=' . $DownloadName);
header("Content-Transfer-Encoding: binary\n");
od_end_clean();
readfile($GPSFile);

[Q] the best tablet for editing wordperfect documents

Help, I'm a lawyer who uses wordperfect (I know not many of us out there) and can't seem to find a tablet that will let me create, edit, convert back and forth from word to wordperfect, etc. Does anyone know if I can edit wordperfect files on an android tablet? On an I-Pad tablet? Or on a Windows based or Windows Based/ Android tablet like the ASUS EEETransformer? Any suggestions?
alexz2229 said:
Help, I'm a lawyer who uses wordperfect (I know not many of us out there) and can't seem to find a tablet that will let me create, edit, convert back and forth from word to wordperfect, etc. Does anyone know if I can edit wordperfect files on an android tablet? On an I-Pad tablet? Or on a Windows based or Windows Based/ Android tablet like the ASUS EEETransformer? Any suggestions?
Click to expand...
Click to collapse
Also a lawyer and would love to see this happen. Corel should make an Android app.
Currently I use a txt based program. Which is fine you just copy and paste all the text and format later. But it would be nice to be able to finish the job on the Android app.
woops I shouldve searched google first....
https://play.google.com/store/apps/details?id=com.corel.wordperfectviewer&hl=en
Its just a viewer though and 6.99 for just a viewer. weak.
WordPerfect files open on Android
alexz2229 said:
Help, I'm a lawyer who uses wordperfect (I know not many of us out there) and can't seem to find a tablet that will let me create, edit, convert back and forth from word to wordperfect, etc. Does anyone know if I can edit wordperfect files on an android tablet? On an I-Pad tablet? Or on a Windows based or Windows Based/ Android tablet like the ASUS EEETransformer? Any suggestions?
Click to expand...
Click to collapse
WordPerfect viewer/editor on Android? For long-time WordPerfect users, it has been virtually impossible to read or write WPD files on an Android device. The only official option, thus far, has been the official and commercial Corel WPD viewer, but the user reviews have been mixed, to say the least.
This problem has prompted me to research and experiment, based on the fact that a free Windows MS Office-compatible suite like Libre Office [or Open Office, or Apache Office] has, for some time, had the ability to open WordPerfect files seamlessly [and save them, sometimes]. I formatted and saved a few basic WPD files, simply renamed the file extension to .ODT, and opened them in Libre Office – virtually perfectly [only experiencing importing issues with some complex tables]. Apart from that, formatting features like different fonts, graphics boxes, numbered outlining? No problem.
Then I proceeded to Android: I copied these test WPD files [simply renamed as ODT files, not exported as Open Office files, remember] to my device/cloud storage services like Dropbox and Google Drive. I installed a number of Open Office/ODT compatible office apps, and tried to open the "new" ODT files.
The best result so far [only been testing for the last 2 days] has come from OOReader [free via the Google Play store]. Opening a disguised WPD file as an ODT file takes a few seconds to convert, and – success! Almost every file I've tossed at OOReader has imported successfully, with WP formatting and graphics intact.
Interestingly, the official Libre Office viewer app [also the beta one] chokes on these FrankenFiles, as well as most other allegedly ODT-compatible office viewers and editors.
And so my 48-hour conclusion and advice are this: If you're a die-hard WPD user and would like to access your files on an Android device, follow these kludgy and hack-ey steps: (1) upload your WPD file AS IS to your device or the cloud; (2) install OOReader on your device; (3) when you need to do so, simply rename the WPD file to an ODT extension, and import into OOReader.
Savvy users might even write a batch script or CMD file beforehand which automatically renames or mirrors important WPD files as ODT files in one's PC Dropbox folder, which will save precious seconds when accessing that beautiful WPD data...
When (if) I find an app which can then also correctly and perfectly edit and save these hacked WPD-as-ODT files, a follow-up report will, well, follow.
Date: 28 May 2016 / Hein / [email protected]

[Q] Send picture from PC to WP7

The data can be sent as a simple byte stream.
I want to capture a PC screen and send it to WP7, I must convert it in server side and reconvert it in client side (I don't know how do that).
The code that I developed to capture the PC screen give me a bmp image extension, and the WP7 can't read that file.
How do I serialize media objects (pictures) for socket transfer??
I want to be able to send pictures files from Pc to WP7 via WiFi using socket.
How can I convert the picture file to what the file extension stream and send it?
I am confused how to do that
juste_3al_faza said:
The data can be sent as a simple byte stream.
I want to capture a PC screen and send it to WP7, I must convert it in server side and reconvert it in client side (I don't know how do that).
The code that I developed to capture the PC screen give me a bmp image extension, and the WP7 can't read that file.
How do I serialize media objects (pictures) for socket transfer??
I want to be able to send pictures files from Pc to WP7 via WiFi using socket.
How can I convert the picture file to what the file extension stream and send it?
I am confused how to do that
Click to expand...
Click to collapse
I think I need to know a little more about what you are trying to do.
I am assuming a program is running on the PC. You want to capture an image of the program. Then send it to the phone through WiFi.
For it to be readable on the phone, bmp will not work. Convert it to jpg. Plenty of free algorithms and libraries can be can be found to do this.
To transfer it to the phone, I would suggest using a webserver or hosting one on the same machine. Possibly Apache, since it is free, but i am more familier with IIS.
Have your app on the pc do a post to page on localhost. Have it pass something on the querystring to identify the phone it is for. This page will store the image in a location on your computer that the webserver has access to.
Now your phone will need an app that will also hit that same ip address, not local host. You will need to know the ip address of the machine. Have it hit a different page and pass that phone identifier. The page will do a redirect to the jpg file. As you recieve the output, write it to to a file on the phone. Using Redirect should automatically send the name and mimetype with the response.
There are other more complicated ways to stream an image, but this is the simplest.
You could always have the webserver be on a different machine entirely, which would make it more generic. Yiou could even have it be hosted so it is accessible from the internet, not just the intranet.
Usign a webserver seems vastly over-complicated to me, but OK. Maybe I'm just more comfortable writing netwrok code than most people...
Take your screenshot (I assume you already managed this). Put it in a format the phone likes (JPEG is good; there might even be BMP-to-JPEG conversion code in the .NET library). Connect the phone and the PC.
This is where the network code comes in. I would personally do this by starting a TCP server socket on the PC on some arbitrary high port, more than 1024 and less than 65000. Have it "Listen()" for a request from the phone. Write a phone app that opens a TCP connection to the PC on that port. Once the phone connects, set it waiting to Receive() data. On the PC side, since some signal that you're going to transfer a file (a realllllly simple protocol would be to just send the file size, as an int, first). There are a few ways to send data on a TCP socket; you can use the Send() function which takes an array (type byte[], which could be populated by using another array and then converting), or a NetworkStream, which is just like any other member of System.IO.Stream (I'm assuming you're writing both ends in .NET, although really simple netcode is actually easier in C). To transfer the file itself, just open it and read it however you like, and send the byte array over the socket. On the phone end, create a new IsolatedStorage file, and write the data coming over the socket into it. Just read in a loop until you've read up to the size that the server told you was coming, or until you hit the end of the stream / the connection closes (which indicates a bug or a problem on the other end).
That's a dead-simple and not very robust network protocol, but it does have the advantage of being trivial to code up...
Or, if that all sounds too confusing, you can try using HTTP. I actually find that to be *more* painful, but YMMV; I cut my first netcode in C and to me HTTP feels needlessly complex by comparison (because it's meant to do so many more things than just transfer a simple byte stream like a file). If you want to look at the source code of an app that uses HTTP to send and receive files, including both the phone app and the PC server app, take a look at WP7 Advanced Explorer (it's on Codeplex). Ignore the parts about filesystem and registry for now, and just look at the network part.
To me the web server approach may seem to be the easiest solution because I have been doing dot net web programming since before dot net 1.1 came out (beta 1.0). Before that I was doing other web development using classic asp, xml, xsl, and javascript. So, I have been working with IIS for well over a decade.
Quite recently, I just worked on dot net code to stream documents and video that is not directly accessible through any virtual directory, without doing a redirect for the purpose of enforcing additional security.
Different types of programmers find different things easier. I have done little to no direct sockets programming since college, so that to me would be more difficult, even if it is actually easier.
It didn't even occur to me to try listening on a port.
Also, now that you mention it, there are ways built into dot net to convert image types. I actually use them in some of the programs I've written for Windows Mobile, such as the FB pic to Outlook Pic application. I might be converting the other way in that app though.
I don't think I do that with web service
I prefer to use the Socket.
My apps let me just view the PC screen
juste_3al_faza said:
The data can be sent as a simple byte stream.
I want to capture a PC screen and send it to WP7, I must convert it in server side and reconvert it in client side (I don't know how do that).
The code that I developed to capture the PC screen give me a bmp image extension, and the WP7 can't read that file.
How do I serialize media objects (pictures) for socket transfer??
I want to be able to send pictures files from Pc to WP7 via WiFi using socket.
How can I convert the picture file to what the file extension stream and send it?
I am confused how to do that
Click to expand...
Click to collapse
With the zune.

[Q] Windows Phone 7.5 hosts file or equivalent

Can anyone provide clear instructions on how to edit the hosts file or whatever functionality does hostname resolution in Mango WP7? The closest I've seen anywhere on the internet are vague references to the Windows Mobile comm\tcpip\hosts\<domain> registry edit which doesn't seem to actually redirect browsers or web service calls (i.e. it's still hitting the production server instead of my test server even after a cold boot).
edit: Oh, and if it matters I'm doing this on an unlocked LG C900 with Mango v7720.

Categories

Resources