How can I access a local file over the web? - filepath

How can I get this to work correctly? I want to access a file form the Z drive on my local machine using this code. How should I put the file path?
embed type="application/x-vlc-plugin" name="VLC" autoplay="yes"
loop="no" volume="100" width="640" height="480" target="z:/familymovies/babysteps.flv"

Do you have a webserver? You need to have one, then you need to put your file in the folder hierarchy that the server serves.
Unless you don't really mean "over the web". If you're on the same machine, use the file: protocol as the other answer says.

You can't just access it that way. One solution would be to run a webserver on your local machine, expose it using something like DynDNS, then access the file via that path.

Related

ASP.Net Accessing Server Filesystem

I am having trouble accessing information on the server my website it on. As the website was originally programmed with VB.Net, I cannot change the language without having to completely reboot the website. The way the website and server are configured, I can only use ASP.Net and VB.Net.
I am needing to add a section where they can create folders, edit folder names, and upload pictures and text documents on the server through the public website. I tried using parts of the FileIO, Server, and Http that should have worked, but none of them did. Most of my research is about local files and text documents.
I have not been able to find any information that works. Can someone help me? Thank you.
Firstly, creating a virtual directory in ISS mapped to somewhere on your disk would be a good start. This way you have a separate folder for user data in a folder with write access (make sure IIS has write access to the folder!), and the folder is not affected by website deployments.
Secondly, you might need to resolve absolute path for most of the System.IO.File calls. See How to convert a relative path to an absolute path in a Windows application?, just you will need to convert this code to VB.

native client filesystem, different domain access same file

For example,on website www.A.com,I use native client filesystem,and save a File named file1.txt. And on website www.B.com, i access the same pexe by using CORS.But the website www.B.com create its own file.Not the same one on website www.A.com. And on my local computer, I find out in the \Google\Chrome\User Data\Default\File System directory, there are two directories named 001 and 002, obviously, they are created by www.A.com and www.B.com.I want to know how to share file between www.A.com and www.B.com
As you've found, the Pepper Filesystem (which is equivalent to the JavaScript DOMFilesystem) is per-origin to the module embedder, not the origin of the pexe. There is no way direct way to share the file.
One possible workaround is to embed your pexe using an iframe. That way it would always use the filesystem origin of the iframe.

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/

Put file at specific port on Localhost

I need to put a file at this address: http://localhost:51547/file.txt
What folder would I put it in on C:/?
Tony
If I understand your question correctly and you're trying to expose a file via the ASP.NET development server at that location (http://localhost:51547/file.txt) I'm afraid the answer is not quite to your liking.
Basically I don't think you can serve files from the root of the ASP.NET development server (i.e right after the localhost:port/ part - the port is automatically selected by ASP but you can also manually configure it). ASP.NET automatically creates a virtual application path right after localhost:por> and so you're most likely going to be limited to serving files from the virtual application folder. So, assuming you web application name is: "testApp", if you put a file called file.txt in the directory where you're storing the source code for "testApp" it will also become available when you're testing at: http://localhost:port/testApp/file.txt (note the testApp in between the host-name & port, and the file-name)
UPDATE
In light of you comment, here's something you could do. You could try to get a simple HTTP server installed on your development computer and have it serve files on a different port (say port 8000). In that case you would serve file.txt using this secondary HTTP server and it would be accessible at: http://localhost:8000/file.txt.
You could try to install Apache or use IIS which comes with Windows. For Apache, the quickest way to get it going would be to install a WAMP environment. You may also try Lighttpd, and also note that MySQL or PHP are not required at all if you're only serving static files.
Any folder you want. The port designator is specified in IIS itself.
http://support.microsoft.com/kb/149605
I suggest you that if you want to do a site(HTTP) is better to use the port 80 or to do a redirection for another port, remember too that localhoost is a loop back and also take a look at PortForward to check some ports that are used by specific applications and types of servers, and please improve your question.
Regards.

asp includes with absolute path

is there anyway to do a #include with a file listed as an absolute path?
i am trying to include files from other websites (outsite the root of the sight that wants to include it)
any other suggestions?
You can only include files from your server, these may technically be outside your website if the Allow Parent Paths option is enabled or if you can use a virtual include to point to another virtual directory on your server.
There is no way to include files from websites outside of your server or sites on your server that your application does not have permissions to access.
Another way to go is to create a directory below the root folder of your website, then making that folder a symbolic link to the folder where the file you want to include is located. Now there is no way to create symbolic links in Windows out of the box, you need Microsoft Sysinternals Junction for that.
<!--#include file="c:\boot.ini"-->
There is a setting in IIS for allowing includes to parent paths, check that if the above doesn't work.
You can do it, using XMLHTTP and the VBscript Execute statement.
I wouldn't recommend it though as it creates substantial security risks.
A few links to get you started:
https://web.archive.org/web/20211020135215/https://www.4guysfromrolla.com/webtech/042602-1.shtml
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsstmexecute.asp
https://web.archive.org/web/20210927184623/http://www.4guysfromrolla.com/webtech/110100-1.shtml
It is a very high security risk, because someone can inject code into your app. Take your precautions.
One tip: the page you need to load from another server needs to have an extension different from .asp because if not the other server is going to send it already executed. It seems clear but I forgot it the first time!

Resources