I have tried two things in regards to get files downloaded from my web server but none has worked. I hope somebody can kick me in the right direction.
I have tried this, which download the files but when I open the files the file will not open. The format is not recognized.
<%
Dim varFiles
Dim ArrFiles
Dim i
varFiles = request.QueryString("downloadfiles")
Response.ContentType = "application/x-unknown" ' arbitrary
if instr(varFiles,",") > 0 then
ArrFiles = split(varFiles,",")
for i = 0 to ubound(ArrFiles)
Response.AddHeader "Content-Disposition","attachment;filename=" & ArrFiles(0)
Next
Else
Response.AddHeader "Content-Disposition","attachment;filename=" & varFiles
end if
%>
The one below here says that the file does not exsist, where the path looks fine:
Function ShowFolderList()
Dim folderspec, fso, folder, foldercollection, file, tmp
folderspec = Server.mapPath("\demotaskMngtupload\UploadFolder")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder(folderspec)
Set foldercollection = folder.Files
For Each file in foldercollection
tmp = tmp & "<a href='\demotaskMngtupload\UploadFolder/" & file.name & "'>" & file.name & "</A><BR>"
Next
ShowFolderList = tmp
End Function
response.write showfolderlist()
I have tried this, which download the files but when I open the files the file will not open. The format is not recognized.
<%
Dim varFiles
Dim ArrFiles
Dim i
varFiles = request.QueryString("downloadfiles")
Response.ContentType = "application/x-unknown" ' arbitrary
if instr(varFiles,",") > 0 then
ArrFiles = split(varFiles,",")
for i = 0 to ubound(ArrFiles)
Response.AddHeader "Content-Disposition","attachment;filename=" & ArrFiles(0)
Next
Else
Response.AddHeader "Content-Disposition","attachment;filename=" & varFiles
end if
%>
The one below here says that the file does not exsist, where the path looks fine:
Function ShowFolderList()
Dim folderspec, fso, folder, foldercollection, file, tmp
folderspec = Server.mapPath("\demotaskMngtupload\UploadFolder")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder(folderspec)
Set foldercollection = folder.Files
For Each file in foldercollection
tmp = tmp & "<a href='\demotaskMngtupload\UploadFolder/" & file.name & "'>" & file.name & "</A><BR>"
Next
ShowFolderList = tmp
End Function
response.write showfolderlist()