For webdav the choices are activex or shared web folders, right? - webdav

In our environment we have IE clients looking over a web page with a document list. When the user clicks on a document we can start MS Word from the activex control Sharepoint Team Services Client (OWSSUPP.DLL) or expose the document list via a Shared Folder that Word can access.
Are there other choices?

One option, which would probably be frowned upon by sys admins, is to create a vbs script file on the fly that the user can choose to download and execute. The contents would be something like
CreateObject("SharePoint.OpenDocuments.2").EditDocument("http://...url here")
Alternatively you could display the url and instruct the user to copy and paste it into the appropriate program (MS Word etc). Adding a button to automatically copy it to the clipboard using something like ZeroClipboard might make it less of a chore for the user.
Otherwise unfortunately I think those are your options. Sorry!

Yes, Microsoft Office now installs plugins for all 4 major browsers. So you can open for editing MS Office documents in Chrome, Firefox, Safari and IE.

Related

How do I download an aspnetForm page with links

I'm trying to download a municipal planning plan together with all the relevant documents.
All documents can be reached from the following link
I've tried the following command (that worked well for other sites) and some variations without success.
wget -E -k -r -l 3 "http://www.mavat.moin.gov.il/MavatPS/Forms/SV4.aspx?tid=4&et=1&mp_id=ppnCWTcsST9gG0%2fa0ayWnjFyZ%2bo14s221Ujlpi7UvR4jIRAHLKhJ8lOLSkomZ%2fvlHk8b2T0oENpI6Wh2hKzxQJCw9BPJP8gav%2ftgiKlk5S0%3d"
The same plan in their new site I can't get the files either,
https://mavat.iplan.gov.il/SV4/1/5000931297/310
I'd appreciate any help.
Well, these days, and especially with .net web sites?
We don't use hyper-links with a simple (full) path name to actual files from the web server. In fact in most cases one will not even give the web server rights to those folders. (they are not exposed to Internet Services).
So, no actual links as a full "url" to documents exist.
What happens is when you click on a button or button link? Then the code behind on the web server runs. (and that is code you don't have). And further more, that code behind can browser, read, retrieve any file from any folder on the server or other servers. But links from the web site don't exist and it not even possible to type in a url to resolve to a actual file name on the server.
So the server side code (not internet services) goes and grabs the document. In fact, the documents could be in a database. So, the code behind on the server side runs and pulls the binary data from the database (which represents a valid PDF file). Or the code behind reads the file from disk and then STREAMS the file for a download.
Now, this is often done for reasons of security. It means that no valid URL exists to get at a document.
Not only is this done for security, but from a developer point of view, it often better to retrieve a row from a database. That row can have the information you SEE rendered on that form, but the web page is not static, and the display of information is thus a developer coding a pull of rows from a database, and then you simply "assign" that data to some type of control - save datagrid, or listview or whatever. (this assignment of data is only 1 or two lines of code, and then the control + web server renders that datagrid control.
So, this is done since the developer thus only assigns the result of a database query to the control when then renders on the form. Thus, to add or remove documents? Then you only have to edit the database for the information on the web page to render.
As a result? There is no direct links to the actual documents on the server. To retrieve a document, you would have to send to the web site the exact command required.
You can hit f12 (most browsers support this). This will put your browser into developer mode. If we do this, and then select elements (select element feature). Now click on a pdf link. You get this:
<img src="../images/ft/file_PDF.gif" style="cursor:pointer"
onclick="openDoc('99000526871729',
'AABA7BE646E182B67DB1C15220E531DF36BBB591D8EEA7757435B2606C08E6F9')">
So, note above. The above code event openDoc is the SERVER side code you have to run to retrive a document. There is thus NO link. And you not going to be able to wire up, or run your OWN web page that hits that server and runs the routine "onclick".
However, the onclick DOES expose the internal database document numbers used to pull/read and retrieve a given document. But the path name, and how the code gets/grabs this file? You have no idea, and HAVE to run server side code (c#, or vb.net) code. That code as noted grabs the file and then uses code to "stream" the file when you download or click on a link.
So for simple HTML like pages? Well, for those that took a one day HTML course? Sure, such web sites will have scr=some path name to a valid url). And these simple systems thus allow you to enter a URL to grab/get a document. And those documents are fully exposed to the web site, and a simple valid URL path name to a file exists. Not so with asp.net, and as noted, this is not only done for security, but it a better over all developer experience to write code that grabs the files as opposed to rendering full path link names to files.
There are many additional benefits. For example, the database that drives this likely has a setting (or some settings) that contain the path names to the documents. If they run out of storage, or say want to move older files to a much slower storage system, which of course is much lower cost? Then can move the files, and update the path name columns in the database. The web site will continue to work, since we NEVER using a exposed URL on the web site. And as noted, actual direct URL's don't exist, and the web server (IIS) as opposed to the code behind will not even have rights to the file names.
As a result?
You not be able to simply pull the web page, and THEN extract the URL's to file names.
What you might be able to do is write code that loads the web page, and then scans all the event code stubs for the links, and have your code click on each button with web browser automation. But, even that don't allow you to enter file names into the download prompts.
So, what you ask is not easy, likely not possible, and a very difficult task. And the simple reason is that site does not use simple HTML and static links to files, and it never actually exposes a direct link to files, and even worse yet is the web server does not have or even allow a URL direct link to a site - they don't exist, and the web site will not even have rights or even allow such URL's to file names. (only the .net code behind does - not internet services).
and grabs the document and then code "streams" the file to to the web site or link you clicked on. So the simple HTML coders in the past would create say a folder (usually a virtual folder) that points to the files on some server/folder. But with .net, it easier (and far more secure).
Modern development tools don't use old fashioned ideas like a URL's to directly retrieve a file - they are designed differently.
In some cases, URL's are allowed or created, and this is done for reasons of sharing links. So if you have a cute video or document? Then the designers of the system will often permit use of parameters in the URL, so you can share a link to someone else. This page has no such provisions. So, you can share a link to the page, but no actual URL to documents or even provisions to allow URL's to a document even exists.
So this quite much means to retrieve a document, you have to go to that web page, and ONLY when you click on a document will the web site "stream" down that one particular document in question.

How to edit word documents from webdav?

I would like to implement a functionality in an MVC3 web application which would allow users to edit Microsoft Office documents directly with WebDAV but unfortunately I have no clue where to start. I have to make links for the documents which, once clicked, would open the documents and after the user saved a document, it should be uploaded back to the server.
Any help is appreciated. Thanks in advance.
You would need probably some web browser plugin (ActiveX or Netscape API), which would handle this for you. You can pass the url of the document (with some authentication cookie) to that plugin on clicking of the link. The plugin than can download the file, open it using ShellExecute or similar (e.g.Launch services on mac) and on close of the file you can upload the file.
This is of course very basic usage and does not employ the strength of webDAV protocol. You should handle webdav locks for example or detect etags of the file before upload etc. to prevent some data loss. You would have to read more about webdav: http://www.ietf.org/rfc/rfc3744.txt.

can we see html localstorage content through client browser?

supppose I use html5 local storage for my website.
1)can End user see my local storage values through browser using view source code etc?
2)How can we enter data for HTML5 local storage as domain level, i dont want to add my records manually when page loads everytime?
3where will HTML5 local storage content be saved?
I)in client side?
II)in server side(webserver)
anyhelp please?
Not through view source, but many Developer Tools support this. So yes, a user could very easy figure out what the contents of their browser's localStorage is. For example, in Chrome, open the Developer Tools, and on the Resources tab select "Local Storage"
I think what you are asking for is "How to I add local storage without writing the code in every page". You would typically then put that code in a common .js file - and reference it whenever you needed it. If you need it in every page, then depending on which platform you are using, they probably have some sort of "master". ASP.NET WebForms has Master Pages, ASP.NET MVC has ViewStart, etc.
Client side. It's local storage - as in it is local to the browser.

How does one print external files (XLS, PDF, DOCX, etc) from ASP.NET?

We have an application in classic ASP that allows user to 'attach' files to information. These can be PDFs, spreadsheets, Word documents, etc.
In the new ASP.NET version, one requested option was for a "Print All" (one user has a situation where there are 34 attached files and, in the current system, she has to open and print each one individually).
The files are kept in a separate directory - not embedded in the database. The database simply contains an ID number and the file's extension so the application would then go out and open "2182.xls" if the user wanted to see it (which would open an Excel window in that case).
Is there a way to send a file to a printer when all you have is the fully qualified filename? (Which I could presumably repeat 34 times in the above example)
Thanks in advance.
Remember that your asp.net code runs on the web server. It's not running on the client computer and has no knowledge of what printers (if any!) are installed there. That's just the way the web works; by design, all a web app can do is open the print dialog for the current page. Anything more, and hackers would use our web browsers for the same kind of spam you get at a fax machine.
That said, there might be some things you can do:
Add an activex control, flash app, silverlight app, firefox plugin, or other plugin code to support the feature.
Render all the attachments on the server into one html document with appropriate styles and javascript so it prints correctly and prompts the user on load.
If this if for a local intranet site (as opposed to public internet) where you have special knowledge of what printers are available for the current user, you could setup all the printers on your server and have it print to the correct location on behalf of the user.

How would you allow users to edit attachments in a web application?

We have created a web application, using ASP.NET, that allows users to upload documents and attach them to business entities, like customers, contacts and so on.
The application runs on the intranet and all files are uploaded through the web application into a shared folder on the server.
I would like, right from the web page, for the user to open the actual file, edit it and then save the changes back to the original location. This is a piece of cake in a Windows environment, I'm just wondering what, if any, is the best way to handle this in a web environment?
The files are usually Word documents, Excel documents and images.
Clarification
We would display all the attachments in a list format. We would like it so that the user would click on an edit link and the file would be opened in the appropriate application, for example, Microsoft Word or Microsoft Excel. I think the file associations in Windows would already handle this. We are just trying to save our user the time to download the original file, make their changes, delete the old file, and the upload the new file.
SharePoint does this by exposing FrontPage extensions which Word and Excel know how to deal with.
If you want to look at a commercial product for ASP.NET that allows you to edit images with AJAX (no need for installed software), I work for a company that has one (Atalasoft)
WebDAV is probably what you want. (Free)
If all your client computers are Windows, map a shared folder on the server to the same drive letter on every client and use the file:// format.
Let's say you share \ServerName\ShareName to H: on every client's computer, the you can make the link as file://h:\pat_to_the_file_under_your_share\fileName.doc
If not every one of the client's computers are in Windows, then you might try to make your links as follows (not sure if ot works):
file://\ServerName\ShareName\pat_to_the_file_under_your_share\fileName.doc
I'm trying to do something with using file:// instead of http:// but it's real sporadic based on the browser. Seems to work fine in IE, okay in Firefox, and goes nowhere in Chrome.
Looks like I may just be stuck with downloading, editing, and re-uploading the document.
It sounds like you want something similar t eRoom, where the browser works in conjunction with a component that intercepts a stream from http, stores it in a temp folder, then fires up Word or Excel and allows you to edit the stream.
You may have to create a component that will intervene and create a temporary local copy of the file.
This tool should do what you need.
http://www.dlitools.com/dlitools/dlitoolsHome.nsf/0FA6B8B31F831F468525736B0001C606/4BBD7E8684EA8DB78525754E006C63A3?OpenDocument

Resources