问题
I'm trying to build an iPad app to download and display documents (pdf, ppt, doc, etc.) from a web server.
Currently it does this by parsing the HTML structure (using hpple
) on the server.
For example, the files are held at:
Http://myserver.com/myFolders/myFiles/
The app goes to this location and traverses the tree, using an X-Path query, e.g.
"/html/body/ul/li/a"
It then downloads whatever documents it finds to the iPad for display.
So far this works quite well but the server is publicly accessable.
My question is, how would I go about doing something similar with a secure server? e.g. is it possible to password protect the server, connect to it with username/password from the iPad and use the same system?
回答1:
In the end I decided not to parse the HTML as there seemed to be no straightforward way to do so. Instead the documents are held on an ASP.Net server with authentication required for access.
It would've been nice to know how to do so by traversing HTML but no biggie.
来源:https://stackoverflow.com/questions/13400918/access-documents-on-secure-web-server