Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i have one project there i need to upload images & document on daily base so image folder space will be incremented automatically. now it will create a problem for server space. so i need to keep this folder on shared drive & want to upload & view image & documents from shared drive only. so any one help me for that or is any other solution?
Posted

1 solution

Refer this[^]
 
Share this answer
 
Comments
Member 11221185 10-Feb-15 2:33am    
I browse that link but my problem not solved.
Please refer my code and help me:
it shows error path not found:
mydt = (DataTable)(ViewState["mydatatable"]);
//DataRow myrow = mydt.NewRow();
DataRow myrow = mydt.NewRow();
int fileSize = fuDocument.PostedFile.ContentLength;

if (fuDocument.HasFile && fileSize > 0)
{
string ext = fuDocument.FileName.Substring(fuDocument.FileName.LastIndexOf(".")).ToLower();
if (ext == ".doc" || ext == ".txt" || ext == ".pdf" || ext == ".xls" || ext == ".jpg" || ext == ".gif" || ext == ".bmp" || ext == ".png" || ext == ".jpg")
{

string Filename = fuDocument.FileName;
string DocumentNameDoc = (Filename);
url = DocumentNameDoc;
ViewState["Doc"] = url;
doc = ViewState["Doc"].ToString();
string url1 = "..\\Images\\Emp Docs\\" + url;
fuDocument.PostedFile.SaveAs(Server.MapPath("..\\Images\\Emp Docs\\" + url));
string mappedPath = Path.Combine("z:\\", "Z:\\Images\\Emp Docs");

string uncPath = Path.Combine("\\\\localhost\\public\\", "D:\\Arshad\\Elink_LeaveManagement\\Images\\Emp Docs");

File.Copy("Z:\\Filename", mappedPath);

File.Copy("D:\\Filename", uncPath);

}

}
else
{
msgDiv.InnerHtml = "";
msgDiv.InnerHtml = "Please upload correct format";
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900