html link to client side file - hyperlink

I am developing in ASP.net a web application which among other things should list documents available on a remote server.
this is for a very restricted number of users for which we can control the end PC.
What i need is the end user to click on a hyperlink and the file would open directly in words or excel for edition and save direct to remote server.
Files will also be available on a very common cloud file sharing system with the "virtual drive" letter (x:)
google doc does give you a unique url for each file but when one click on the link it opens online not in the local Microsoft Word. these is a plug in for office but document have to be open from word not from the webapp.
So the idea would be to create a windows explorer link to the file to open "file.lnk".
and set the browser to open lnk extensions with Explorer.
link
where test.lnk is an explorer link to the targeted file on the virtual drive.
this sound a bit dodgy, i agree, as it only works on windows.
this actual works ok as long as the htlm file is run on the local machine ( d:\app.htlm) but does not work when the html file is served on a remote web server ( mydomain.com/app.html)
Question:
why is the link on client side not served from the remote web server?
is there a simple implementation of editing MS office documents opened from the web browser without monster application like sharepoint or Alfresco?

Related

Excel file download not working on server

I have a strange problem.
we have a website, from where the user can download excel files. In my local system the excel file is downloading ok, but in the life site the excel download it is not working.
I have observed that if I open remotely the server machine, teh excel download suddenly works on the life site too, but if I close the remote it does not work.
I think that it is a permission issue, but I could not realize yet, what can be the problem.
I have tried these settings:
Navigate to Component Services > Computers > My Computer > DCOM Config
Locate the MS application giving you trouble (eg: “Microsoft Excel Application” for Excel or “Microsoft Word 97 – 2003 Document” for Word)
Right click > Properties
On the security tab: Select Customize under Launch and Activation Permissions and click Edit…
Add the account under which the site is running (eg: Network Service) and assign Local Launch & Local Activation permissions
this is what I have founded on the net, but it is not working...
Any help is appreciated.
Add Content-Disposition header in your response
var cd = new System.Net.Mime.ContentDisposition
{
FileName = "MyFile.xlsx",
Inline = false,
};
Response.AppendHeader("Content-Disposition", cd.ToString());

Is it possible to print to a local printer with CFFILE?

I'm building an application in ColdFusion that lets the user choose a group of photos and will let them be printed automatically, however, I need to print the file and not the webpage holding the images. Is this possible with CFFILE? If not what is the best way to do this?
Dan's suggestion of an Active-X control (even if it's possible) will only work for MSIE 11 and earlier. Active-X will not work for MS Edge or any non-MS browser. It's not a global, future-proof solution.
The best solution will be to convert the images to a multi-page PDF file as TRose suggests. You will then present the file to the user to download or view in the browser. The user will have to manually print the PDF file.
Here's why: ColdFusion is a server-side applicaiton server. It crafts content that is viewable via a web browser. For security reasons, web browsers cannot automatically aceess a user's local computer(1) and therefore cannot connect to any printer connected to that computer.
(1) This is also why we can't upload files without user interaction.

Want to open a dialog box to open file in web browser based application

Am using JSF and primefaces to develop web application.I want to open existing files on client machines using dialog box which prompts the user to select a path and the corresponding file. Please suggest a component which can be used.
While I doubt the feasibility of your intentions; accessing content directly on a client's machine (some security implications there), a combination of <p:media/> and <p:lightBox/> will work for you. There are file type restrictions imposed by primefaces though (multimedia files and pdf only) The <p:media/> can be embedded in the <p:lightBox/> like so :
<p:lightBox>
<p:media value="{yourBean.filePath}" width="100%" height="300px">
</p:lightBox>
Like I said, I doubt the feasibility of directly streaming content from a client's local filesystem. How do you intend to use the path c:\Users\john doe\my documents\my books\book.pdf on a user's local system within your own web application, without first uploading the file to your own webserver? With image files, you might have some success loading the file into memory and streaming the file directly from RAM using <p:dynaImage/>...consider the scalability of this option too for a high traffic application

open an excel file located on the server instead of download it MVC

I'm building a Reporting web application right now with MVC3 and I've come up to a couple problems.
My goal is to have it able to generate and view Crystal Reports, SSRS reports, and Excel documents.
Right now I'm working on the Excel segment and I'm running into more trouble than I thought I would. First off, when I link directly to the file, it either opens inside the browser or it downloads it from the server and if the user makes changes it doesn't actually save it to the true file on the server.
I've tried both linking to the file directly using Razor and a ViewModel with the path to the document as well as directing it to an action that returned a File.
I've also tried linking it to a shortcut to the actual file thinking that if I could open the shortcut it would open the file the way I wanted it to and unfortunately it didn't really open at all.
The users already have access to the files on the server through a network drive, so as of right now they can go into the server, open the excel document, edit and save it no problem. I want to duplicate this effect through a link. The program already has a file browser built, so I can browse between the files and make links to the reports.
Thanks in advance!
Since they are apparently on a network drive, you can just link to the files directly, relative to the user?
For example: a link to file://///SERVERNAME/folder/
I tested it between two computers on the network, and that seems to work. However, you still get a popup asking that you want to do with the file, open or save. (both in firefox and IE)
Note: Yes, that many slashes seem necessary, lol

Open a file that is on a file server from a webpage?

I am working on an internal application. We have a website that displays all our SSRS reports for a group of work. I have been asked to see if I can link all the files (pdf, word, excel) for the group of work. These files are stored on a file server that users viewing the reports have access to. Each group has its own group of reports and shared files.
Is it possible to open the files (without downloading them) from a webpage? Meaning that they file is opened from the file server? I don't want people to download a copy of the file.
I am pretty sure this can work with IE because sharepoint does it. However, other browsers may have an issue.
EDIT: What I would like is to have a web page with links to the files. When they click on a link (say for a word doc), word will open the file that resides on the file server. Without out a local copy downloaded from the network share.
EDIT2: Please note, I know what I am asking is probably not possible in all browsers. I am more or less just making sure. It seems possible in IE using activeX, but out side of that browsers do a good job at keeping processes inside a sandbox.
3 options. Remember this is for an internal website.
link to the share using file://. This will have the side affect of downloading the file to be viewed. As long as user clicks open every time it should not be a big deal.
Use JavaScript and activeX to open word (excel, reader, ect) passing in the file path as a command line arguments. This works only in IE and in win7 (probably vista) user will get a pop up asking if it is ok for the activeX control to run.
Create a new protocol. openfile://. This would be set up to run an application that is installed on the client machine which would open the file. Since it is internal, the application could be installed on the machines without issues. This also requires a registry change.
I haven't picked one as this change is still being looked into but i figure I would update this in case someone runs into something similar.

Resources