Accessing WebDav from Server Link - webdav

I've downloaded the .Net Server and ajax library
We need to be able to edit documents directly from the WebDav Server.
I've succeeded doing so with the javascript code using MicrosoftOfficeEditDocument and JavaEditDocument
I'd like to be able to have in my pages a link as follows
\server\DAV\path\file
When I place a similar link like above, it doesn't open the file. When I copy link and place in windows run command, it opens
Is it possible to have direct links to webdav storage files for opening?
Also, Is there a planned solution for the jar file running in Chrome?
I've followed the instruction for https://java.com/en/download/faq/chrome.xml#npapichrome
This allows chrome to load the jar file, but They say they stop supporting.

To open a document from a web page your link must be HTTP or HTTPS, that is start with http://server/. It would not work with a network path.
In your case URL must look like http://server/DAV/path/file.ext

Related

Rooted Path and FileUpload Control

I know it's been asked and I have read the posts and Googled this all day. Still nowhere near something that works. Using an .aspx page, I need to upload a .pdf file to a specific website. I'm doing development using VS2017 and VB.Net. The app will run on different websites. It needs to upload client files to a specific different website and path. Also, the file name of the uploaded file will not be the same as the local source file. Creating the new name is no problem.
Let's say a local file must be uploaded to a website at https://www.appfileserver.co.za/pdfdocs, but I'm on https://www.myownsite.com. So, when using FileUpload1.SaveAs(rootedpath) the path that goes in there must be the rooted path to the target. What would the rooted path look like for the example I provided?
FYI, I know the IP addresses, http paths and anything else I need to know because I control those sites. It would be great to do an FTP upload. I have done this many times from desktop apps. Unfortunately I'd need the full path to the local file. It seems there is no way a web page is allowed to get that full path, so FTP upload is out - or is there a way?
After battling for two days trying to FTP upload from website to website (which is not possible because server firewalls block this), I finally solved it. The solution was a simple one. I deployed the upload .aspx file on the target server then embedded that in an iframe on the client machine apps. The files are then uploaded one time to the right place. Simple and 100% effective. Hopefully somebody see's this and understands it - so as to avoid the troubles I had.

Is there any feature is providing the microsoft teams to load static web pages(html/aspx) in browser

I am trying to upload the html file and aspx file in teams. once it is loaded then get the copy of files address
and i am going to load that copied path url in browser but it is not showing web content which i design like web page.
in browser (html/aspx) files are downloading. If i am trying to load apsx file in browser it was showing like error(Something went wrong File Not Found),
so want i like is that is there any feature to load in browser?
Thanks for your detailed explanation.
First of all, Teams does not host any html or aspx file itself. So you can not upload a file and use the URL to render web page in browser. The file URL is a link to that uploaded file location. That's the reason the file is getting downloaded in browser.
Secondly, it is other way round. You can run your website in any other server and use that URL to configure a tab in MS Teams.
Please go through these links
What can Teams apps do?
How do tabs work?

How can I link a WebDAV URL within windows explorer (w7) to a regular folder instead of using a network link (standard)?

Normally a WebDAV URL shows up as a network link within the table of root directory trees (c:/; d:/). I would like the WebDAV URL to be accessed from a regular folder e.g. c:/user/download.
How do I link the URL manually and/ or using the msdn WebDAV API for script configuration?
Thanks!
I dont know of any windows clients that can mount a drive into a local file system. A couple of options
Mount a drive like normal and then use a linked folder (ok, not a great option)
Use a file sync client to sync a local folder to the webdav server
There are a handful of sync clients around. Here's a new one that looks nice, although i havent used it - https://www.syncany.org/

Force file download in a browser using ASP.Net MVC when the file is located on a different server without downloading it on my server first

Here's what I would like to accomplish:
I have a file stored in Windows Azure Blob Storage (or for that matter any file which is not on my web server but accessible via a URL).
I want to force download a file without actually downloading the file on my web server first i.e. browser should automatically fetch the file from this external URL and prompts the user to download it.
Possible Solutions Explored:
Here's what I have explored so far (and why they won't work):
Using something like FileContentResult as described here Returning a file to View/Download in ASP.NET MVC to download the file. This solution would require me to fetch the contents on my server and then stream from my server to the browser. For this reason this solution won't work.
Using HTML 5 download attribute: HTML 5 download attribute would have worked perfectly fine however the problem is that while it is really a very neat solution, it is not supported in all browsers.
Changing the file's content type: Another thing I could do (at least for the files that I own) to change the content type property of the file to something that the browser wouldn't understand and thus would be forced to download the file. This might work in some browsers however not in all as IE is smart enough to go beyond the content type and sees the file's content to determine the content type. Furthermore if I don't own the files, then I won't have access to changing the content type of the file.
Simply put, in my controller action I should be able to specify the URL of the file and somehow browser should force download the file.
Is this something which can be accomplished? If yes, then any ideas how I could accomplish this?
Simply put, in my controller action I should be able to specify the URL of the file and somehow browser should force download the file [without exposing the URL of the file to the client].
You can't. If the final URL is to remain hidden, your server must serve the data, so your server must download the file from the URL.
Your client can't download a file it can't get the URL to.
You can create file transfer WCF service (REST) which will stream your content from blob storage or from other sources through your file managers to client browser directly by URL.
https://{service}/FileTransfer/DownloadFile/{id, synonym, filename etc}
Blob path won't be exposed, web application will be free from file transfer issues.

How to launch an EXE from Web page (asp.net)

This is an internal web application where we would like the Web pages to contain links to several utilities that are Win32 EXE. The EXEs are trusted and produced by us. (don't care if it asks if its ok to Run or Save). I tried direct link (e.g. C:\notepad.exe) which works locally only. (This will be a share on the network). Tried File:/// and did not work.
IE7 is the browser needed.
This assumes the exe is somewhere you know on the user's computer:
Launch the executable
<script>
function LaunchApp() {
if (!document.all) {
alert ("Available only with Internet Explorer.");
return;
}
var ws = new ActiveXObject("WScript.Shell");
ws.Exec("C:\\Windows\\notepad.exe");
}
</script>
Documentation: ActiveXObject, Exec Method (Windows Script Host).
How about something like:
<a href="\\DangerServer\Downloads\MyVirusArchive.exe"
type="application/octet-stream">Don't download this file!</a>
You can see how iTunes does it by using Fiddler to follow the action when using the link:
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=80028216
It downloads a js file
On windows: the js file determines if iTunes was installed on the computer or not:
looks for an activeX browser component if IE, or a browser plugin if FF
If iTunes is installed then the browser is redirected to an URL with a special transport: itms://...
The browser invokes the handler (provided by the iTunes exe). This includes starting up the exe if it is not already running.
iTunes exe uses the rest of the special url to show a specific page to the user.
Note that the exe, when installed, installed URL protocol handlers for "itms" transport with the browsers.
Not a simple engineering project to duplicate, but definitely do-able. If you go ahead with this, please consider making the relevant software open source.
In windows, specified protocol for application can be registered in Registry.
In this msdn doc shows Registering an Application to a URI Scheme.
For example, an executable files 'alert.exe' is to be started. The following item can be registered.
HKEY_CLASSES_ROOT
alert
(Default) = "URL:Alert Protocol"
URL Protocol = ""
DefaultIcon
(Default) = "alert.exe,1"
shell
open
command
(Default) = "C:\Program Files\Alert\alert.exe"
Then you can write a html to test
<head>
<title>alter</title>
</head>
<body>
<a href="alert:" >alert</a>
<body>
As part of the solution that Larry K suggested, registering your own protocol might be a possible solution.
The web page could contain a simple link to download and install the application - which would then register its own protocol in the Windows registry.
The web page would then contain links with parameters that would result in the registerd program being opened and any parameters specified in the link being passed to it.
There's a good description of how to do this on MSDN
Did you try a UNC share?
\\server\share\foo.exe
Are you saying that you are having trouble inserting into a web page a link to a file that happens to have a .exe extension?
If that is the case, then take one step back. Imagine the file has a .htm extension, or a .css extension. How can you make that downloadable? If it is a static link, then the answer is clear: the file needs to be in the docroot for the ASP.NET app. IIS + ASP.NET serves up many kinds of content: .htm files, .css files, .js files, image files, implicitly. All these files are somewhere under the docroot, which by default is c:\inetpub\wwwroot, but for your webapp is surely something different. The fact that the file you want to expose has an .exe extension does not change the basic laws of IIS physics. The exe has to live under the docroot. The network share thing might work for some browsers.
The alternative of course is to dynamically write the content of the file directly to the Response.OutputStream. This way you don't need the .exe to be in your docroot, but it is not a direct download link. In this scenario, the file might be downloaded by a button click.
Something like this:
Response.Clear();
string FullPathFilename = "\\\\server\\share\\CorpApp1.exe";
string archiveName= System.IO.Path.GetFileName(FullPathFilename);
Response.ContentType = "application/octet-stream";
Response.AddHeader("content-disposition", "filename=" + archiveName);
Response.TransmitFile(FullPathFilename);
Response.End();
if the applications are C#, you can use ClickOnce deployment, which is a good option if you can't guarentee the user will have the app, however you'll have to re-build the apps with deployment options and grab some boilerplate code from each project.
You can also use Javascript.
Or you can register an application to handle a new web protocol you can define. This could also be an "app selection" protocol, so each time an app is clicked it would link to a page on your new protocol, all handling of this protocol is then passed to your "selection app" which uses arguments to find and launch an app on the clients PC.
HTH

Resources