download and upload

Posted by Pks under C# category on | Points: 40 | Views : 361
How to upLoad Folder in D drive and download folders from same folder in c#.
I have a code but it is not working properly on server. But it work on local host easily .i have only a single web page and i want to upload any webpage on any website on live server help of this web page.My webpage code is.I have two website on website1 and website 2. I want to upload .aspx and. cs page on these website and also download .
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;

public partial class upload_new : System.Web.UI.Page

private void Page_Load(object sender, System.EventArgs e)

protected void btnUpload_Click(object sender, EventArgs e)
//Files is folder Name
fuSample.SaveAs(Server.MapPath("~") + "\\D:\\Praveen Sharma\\Office Work\\Website\\Upload File\\" + fuSample.FileName);
lblMessage.Text = "File Successfully Uploaded";

////////HttpPostedFile file = Request.Files["myFile"];

//////////check file was submitted
////////if (file != null && file.ContentLength > 0)
//////// string fname = Path.GetFileName(file.FileName);
//////// file.SaveAs(Server.MapPath(Path.Combine("~/Files/", fname)));


Comments or Responses

Posted by: Professionaluser on: 3/21/2016 Level:Bronze | Status: [Member] [MVP] | Points: 10
You post above issue in the Forums section in; The purpose of Forums section is to resolve the issues or guiding DotNetFunda users in the direction of resolution

Login to post response