0

I have a webpage, where we upload files to a location based on the recid of the row.

This upload looks to see if a folder exists with the recid, if not then it creates the folder if so, it just uploads the file.

Now I am wanting to VIEW everything inside the folder, allow them to click on the file they want to open. (Alternatively I could just open every file inside the corresponding folder, if this other route is not possible)

I am getting: enter image description here

The "View Uploads" button is very simple ahref...

<td align="center" valign="center" nowrap class="bodyTextTLR"><a href="file://lanswinweb1/c$/inetpub/wwwroot/seq/reorderpage/<% =rsTemp1("recid") %>/">View Uploads</a></td>

When I hand type the link into the browser it works. enter image description here

I know there are a bunch of threads going around that are saying that chrome has some kind of built in feature that restricts this from happening... But still have yet to see a real fix, unless I am just being special... I am wondering now if I would even be able to open the files if I cannot get this route to work??

Anybody have any ideas? Need any more information?

  • Perhaps duplicated question: http://stackoverflow.com/questions/39007243/cannot-open-local-file-chrome-not-allowed-to-load-local-resource – Zam Oct 26 '16 at 14:31
  • This would only work if every user that was going to view the report, did this on their own machine. I need to find a way to display what has been uploaded without making the user do something other than click the button. – Kyle Vbcrlf Rickaby Oct 26 '16 at 14:55
  • How about enabling `allow directory browsing` in IIS ? in this case you are not goint to use FILE:// link, it will be regular URL link. See: http://1click.lv/d/ – Zam Oct 26 '16 at 15:25
  • This was an option... I am not a network guy so I dont deal with those settings very much... I took them to our network admin and he would prefer not to use these... I ended up going a different route, will post the code that I used after it is finished and working. – Kyle Vbcrlf Rickaby Oct 26 '16 at 18:25

1 Answers1

1

Short answer - you can't do what you're trying to do due to browser security.

Instead, write code on the server to list out the files as a webpage, e.g.

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFolder("c:\test\")

' loop through your folder contents    
for each fil in f.files 
 response.write("<a href=""" & file.name & """>" & fil.name & "</a>")
next

set f=nothing
set fs=nothing
%>
BlueSix
  • 131
  • 2
  • 9