Skip to main content
gamedev.net
🔒 Locked

[web] ASP open network folder

Started by grizzlebee 5 replies 2k views
Original Post
grizzlebee
grizzlebee
Hi, I am making an ASP application that has a button that will open a network folder. The person using the application is assigned with permission to view the network folder. lets say the network path is //network/path/destfolder. When the user clicks the button a new window should just open with the path to the network folder where the documents are //network/path/destfolder The problem I am having as new to ASP is thinks like shell() wont work for me. Do I have to use javascript or something? Is VB onclick for the button capable of opening this location for me in a new window? How syntactically should I proceed? Thanks
markr
markr
I think you are somewhat confused about how ASP works.

Active Server Pages runs on the web server. It can't "open a folder" on the client side. This would only be possible if the client OS were to cooperate - which it is unlikely to for security reasons.

Active Server Pages can only access files on the server side - and it can't make them appear as local files to the client. You can only do what the client lets you.

Mark
grizzlebee
grizzlebee
So there is no way for me to make a "Open Folder" button on my asp page:(? Even with javascript?
Michalson
Michalson
No. Not if you are trying to do what markr thinks you are trying to do, though your original post is filled with ambiguity - *whose* network is this folder on? Does the users *local* account have access to this folder, or is it a server side account that has access to it?

Also, you are not terribly clear when you say "a new window should just open with the path to the network folder". That could mean a window with a piece of text that says "//network/path/destfolder", it could mean an explorer window (you seem unfamiliar with the distinction between browser and OS), or it could be some server provided view of the share.
grizzlebee
grizzlebee
Sorry. The user can type the \\networkpath\\folder\05SS url in explorer and go to the folder. They have permission to view it. I want them to click a "open folder" button on the asp web application and it will open a new window internet explorer with the location "\\networkpath\\folder\05SS". I am using a javascript function right now and it opens a new IE window ,but it messes up the location right now and i cant figure out why.
it keeps changing to this

http://localhost/folder/SS

I hope that explains it a little better.

Private Sub btnFOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFOpen.Click        Dim url As String = "\\networkpath\\folder\05SS"        Response.Write("<SCRIPT LANGUAGE=""javascript"">window.open('" & url & "','', 'width=850, height=260, left=200, top=200, location=yes')</SCRIPT> ")    End Sub
Michalson
Michalson
You need to learn javascript (or C, or C++, or any language that has standard \ string escape codes) to understand why this is happening. As a side note, using \ slashes is very platform specific. Even look at what IE does to the URL - it converts them to internet standard / slashes.
grizzlebee
grizzlebee
Thanks that worked just fine fixing the slashes.

Dim url As String = "file://network/path/destfolder"

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.