Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to make a download server

Status
Not open for further replies.

andyUK

Programmer
Dec 19, 2000
39
0
0
GB
Having problems when i try to download files form a set locaation on our webserver, ie
when i run i on my local host is it grand but when i do it live on the productions server it says it can find the file, but the files are definitly there :S
 
This might solve your problem.

Edit the directory info for your web server. Ours was download2 so edit that part. You must save this file as an ASP page.


<HTML>
<HEAD>
<META NAME="GENERATOR" Content="The Spider's Parlor">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>Customer Support Download Page</TITLE>
</HEAD>
<BODY>
<!--
This page created by Mark D. MacLachlan, The Spider's Parlor
-->

<table height=100%>
<tr>
<td bgcolor="84A5C6" width=17% height=100%></td>
<td valign=top>

<%


set directory=server.createobject("scripting.filesystemobject")
set allfiles=directory.getfolder(server.mappath("/download2/"))

' Lists all the files found in the directory
For each directoryfile in allFiles.files

%>
<a href=/download2/<%
' Write out the name of the document
response.write server.urlencode(directoryfile.name) %>><% response.write directoryfile.name %></a><br>
<%

' End for next loop to list documents
next

%>


</td>
<td bgcolor="84A5C6" width=17% height=100%></td>
</tr>
</table>


</BODY>
</HTML>


I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Thanks for your help Mark


I tried this script on my local machine and it was great, but when i put it live on the server it displays the files okay but when you click on them it says the file cannot be found.

Do you think there is some setting on the server that I might need to add or change?

Thanks

Andrew
 
Definately sounds that way.

When you look at your web site in IIS do you see the folders listed that hold your files?

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
yeah can see the files under the shared folder using iis :( seems very strange. I tried it on a different remote server it it handled it fine just this server :S

Andrew
 
Maybe you should consider making a new web site and let it rebuild all the defaults.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
seems to be the same on 2 servers in here, but on my own personal webhost externally its fine. Confusing!

Andrew
 
That is strange. Soundls to me like IIS is messed up.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top