Force download file (ASP)
Any file on a web server can be downloaded to the client. The IUSR_MACHINENAME (or Everyone) account needs read access to that file for it be be downloaded. MDAC 2.5 or later is needed for this to work - http://www.microsoft.com/data/download_250rtm.htm JScript: // clear buffer Response.Buffer = true; Response.Clear(); // path to file var sFilePath = Server.MapPath("/path/to/file.pdf"); // attachment name (without extension), this will be what the name of the downloaded file will be var sAttachName = "attachmentname"; // remove spaces, else file may not download sAttachName = sAttachName.replace(/\s/g,""); // create filesystem object var oFSO = Server.CreateObject("Scripting.FileSystemObject"); // check if file exists if(!oFSO.FileExists(sFilePath)){ Response.Write('<strong>File does not exist. <a href="'+Request.ServerVariables("HTTP_REFERER")+'">Go back</s>.</strong>'); Response.E...