Hyperlink to a network share - html

My scenario is this:
I have two network shares (on the same network) that I would like to construct them as a A HREF network share. I tried to make it work with all the solutions given here but couldn't succeeed. These A HREF links are generated on the fly thru a application and sent as a HTML Outlook e-mail. I wanted the link to look like this in the Outlook HTML e-mail.
\\remote_machine_name\sharename1\Windows\notepad.exe \\remote_machine_name\sharename2\SCANDISK.acc
So, all I need is make notepad.exe open on the remote machine along with SCANDISK.acc open on the same remote machine and as a input to notepad.exe. Please note that the remote machines are same both for notepad.exe and for the .acc file but the share names are different.
Btw, I'm also thinking of another possibility of generating javascript code on the fly from the application and take the .acc file as an input and in the javascript method, open notepad.exe and input .acc file to it. Will this work?
As a side note, whenever I click on the .acc file link in the HTML Outlook e-mail, I'm getting a warning from Outlook with a dialog that shows (Open, Save and Cancel).
Please help.

You'll want to do something like this:
file://///servername/sharename/path/to/file/file.ext
There are five slashes after file: and they mean: /// for the file protocol and // for the path to the server. A normal windows path would be like this:
\\servername\sharename\path\to\file\file.ext
All you need to do is reverse the slashes and append it to file:///

Weird answer that works for on new Edge
Im new to HTML and coding in general but i got this to work using this code
make sure you add (<)p(>)(<)a(>) but without () and before href
cant show it all together otherwise it will not show the code on here
href="\server\folder\location" target="_blank" rel="noreferrer noopener">test
The code is a website link opener that will open said folder in a new browser tab.
"test" being the visual hyperlink name that users will click on. This should work on cloud drives in your intranet as well local drives.

Related

How to show File Saveas Dialog in Blazor Server App

I am new to Blazor and trying to show File Saveas Dialog as shown in following link on a button click.
Save as Image
The requirement is - upon clicking the Saveas button above Saveas dialog should be popped up where user can choose the destination of file and file name.
I have tried "enabling the setting to check the save location in the download settings of the browser" and it works. But we do not want to depend on the Browser settings.
Please add your thoughts on below..
Instead of depending on the browser settings is there any other way to show Saveas dialog?
Are there any open source Nuget packages available to help on this?
NOTE: I am using .NET 6.0 for building my application
Thanks in advance,
Bhargavi Gowri.
I also wanted to bring up a window to save a file in which the user could select a folder. Before that, the system automatically saved to the Downloads folder.
As I understood, there was no such possibility before, but now it is possible thanks to this api: https://caniuse.com/native-filesystem-api.
I found this solution in the answer to this question: https://stackoverflow.com/a/70001920/16740180.
It's worth noting that I use Blazor WebAssembly and not a Blazor Server. And I do not know if it will work for you.
Unfortunately, this doesn't work for mobile devices right now, but it works fine for windows. I hope this helps someone.
This isn't a Blazor thing. In web browsers, files are downloaded from links using <a> tag in HTML using the download attribute. Just create a link to your file:
<a href="path_to_file" download>Save</a>
Save
The path must be on the same server, but blob and data links will work as well.
If you do not suggest a name, the browser will use the original filename (possibly changed to remove symbols the OS doesn't allow in file paths).
https://caniuse.com/download
If you want your link to look like a button, then that's a different issue, and you can google or ask that.

What's wrong with this HTML page that I created?

I'm taking a programming class on Lynda.com and I just finished creating this HTML web page, but it's not opening on a web browser. Can someone help me figure out what I did wrong? Thanks! :)
Here's what I did:
Picture
I took a look at your code and it not only looks correct, it displays for me on Chrome, Firefox, Opera, and MS Edge.
I'm thinking that it may be the manner in which you are trying to access the file to display.
Follow these two solutions and see if one of them works for you:
Solution 1) Find where on your hard drive you are saving your "body.html" file. When you find the file, click on it and it should automatically open the file in whatever your default browser is for you.
Solution 2) If you are trying to manually type in the directory address for your "body.html" file inside the web address box of your browser, make sure you are writing the address correctly. Remember, the address is coming from your hard drive and not the internet itself. A format would look something like this:
C:/Website-Projects/body.html
or try:
C://Website-Projects/body.html (***the only difference is the 2 back slashes instead of one).
in the example above, "C" stands for the designation of my hard drive, "Website-Projects" is the name of the folder on my "C drive" that my target file is in, and "body.html" is the target file I'm trying to open within the "Website-Projects" folder.
Give those two solutions a spin and see if that helps.

Is there any way to open a local file from a html code in google chrome?

so, i've ben hunting for the answer, and seems like i can't get this to work, i wanted to make so that, i have a browser page already made in html, and when i click a link in there, it opens a chosen folder on the computer, but i don't want it to open on just this computer's path, I wanted to open a folder that is inside the main folder, so that anyone that has the same files as I do, can open it, i tried < a href="File_path">, tried putting < a href="file:///(file path)">, tried like i have in excel ../../'file path', and can't see where is the problem, anyone can help?
Here you need to use a "file" protocol to link a file in the HTML like,
Link
The browser may or may not open the file due to the security setting. You can click the right button and choose "copy link address" and then paste it into the browser.
There are security implications of showing a local file/folder from an website. It may work when the page is held locally but when on a server it will be failing. However definitely not any chosen folder anywhere in your PC.
If you require to achieve such you need custom implementation using a programming language like ASP .NET like shown in this example.
https://stackoverflow.com/a/6047826/684030
You haven't mention much details on what web server you are using. But if it's IIS (Windows) you may consider allowing directory browsing which may allow to show a sub directory under your website.

Hyper Link That Opens .OFT in Outlook

I have some Outlook .oft template files uploaded to a web server.
Is it possible to create a link to the individual files that will result in them opening in outlook?
I have thus far only managed to create straight up HTML links that simply downloads them to folder.
Is it possible to create a link that associates the .oft file with outlook and therefore executes it and opens it as the email ready to send.
Thanks
I am not sure I understand the problem - if Outlook is installed, it associates .OFT files with itself. If a link points to an OFT file, opening the file will launch Outlook.
If you mean to bypass the Save/Open prompt in a browser, I don't think there is a way to do that.
When you click the link and it shows the download right click and say always open this kind of file then click to open. After that everytime someone clicks the link it will just open up.

The links to .xls files will not work on my intranet site?

I am currently building an asp intranet site.
There are various helpful links that I need to include and some of them happen to be .xls files that are located on a local network within the company.
I link these documents just like I would any word docs (which work fine by the way).
<span>Schedule</span>
The link above works if I simply copy and paste the raw address into my browser (a pop-up window comes up asking me to open the file in Excel). But when I make this a link on the intranet site and try to click on it, nothing happens. I can see the link when I hover over it on the status bar but that's it. It is non-clickable. Anyone have any idea what is causing this and how to fix it?
I should mention that two of these .xls files are password-protected but one of them is simply a read-only file which can be opened by anyone.
I am 100% sure this has nothing to do with css styling because the same thing happens in the current (old) intranet site made by someone else and I use these links on different menu bars as well.
I think you use wrong syntax for shared files, try this:
file:///P:\-Projects-\SCHEDULE.xls
Backslashes are still valid for the path part. Moreover, I'm not sure whether Sharepoint may recognize correctly path to most likely network drive P:.
For me such link to local share works:
file:///\\fs-1\Install\Windows\Servers\DB\MSSQL\SQL2005\en_sql_server_2005_service_pack_4_x64.exe
The solution to this problem is to add the site to the "Trusted Sites" list.
Opening intranet files without the user knowing is considered a secruity threat.
In IE go to Internet Options -> Security -> Trusted Sites then add the site.
http://answers.microsoft.com/en-us/ie/forum/ie9-windows_7/after-latest-update-ie-wont-open-network-file/172e4ac3-1c1f-4948-8a3f-c8c344eae06d