Tuesday, June 3, 2014

File Upload and Download File from IIS Server.



First share any folder in any Drive.
Create a site for those files in IIS.
Design the form as follows.





cs Page





Web.config
<addkey="TemplateUploadPath"value="\\ABC-DTTR\Templates\"/>
<addkey="PDFDownloadPath"value="http://localhost:8089/"/>
<addkey="PDFDownloadPhysicalPath"value="\\ ABC-DTTR\Templates \"/>


Run the page.


Now, I want to download the upload file.
GetDownloadPage.aspx
 



.cs Page

In page load

stringstrTemplatePath = "mvc-routes.pdf";
stringstrTable = "";
strTable = "<table border='0' width='100%'>";
strTable = strTable + "<tr>";
strTable = strTable + "<td style='width:5%'>";
strTable = strTable + "<imgsrc='images/images.jpg' />";
strTable = strTable + "</td>";
strTable = strTable + "<td style='width:10%'>";
strTable = strTable + "<a href='GetFile.aspx?Filepath=" + strTemplatePath + "'>Download</a>";
strTable = strTable + "</td>";
strTable = strTable + "<td style='width:80%'>";
strTable = strTable + "<a href='#' onclick='javascript:window.open(\"" + System.Configuration.ConfigurationManager.AppSettings.Get("PDFDownloadPath") + strTemplatePath + "\")'>" + strTemplatePath.ToString() + "</a>";

strTable = strTable + "</td>";
strTable = strTable + "</tr>";
strTable = strTable + "</table>";
divTable.InnerHtml = strTable;









GetFile.aspx






OUTPUT:




No comments:

Post a Comment

Thank you for visiting my blog

Kubernetes

Prerequisites We assume anyone who wants to understand Kubernetes should have an understating of how the Docker works, how the Docker images...