Click here to Skip to main content
15,885,365 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: difference Pin
Anuja Pawar Indore5-Mar-12 21:24
Anuja Pawar Indore5-Mar-12 21:24 
QuestionASP.Net Best Environment Pin
Zeyad Jalil3-Mar-12 22:25
professionalZeyad Jalil3-Mar-12 22:25 
AnswerRe: ASP.Net Best Environment Pin
Jörgen Andersson3-Mar-12 22:42
professionalJörgen Andersson3-Mar-12 22:42 
GeneralRe: ASP.Net Best Environment Pin
Zeyad Jalil3-Mar-12 22:48
professionalZeyad Jalil3-Mar-12 22:48 
AnswerRe: ASP.Net Best Environment Pin
Lakxman16-Mar-12 2:39
Lakxman16-Mar-12 2:39 
Questiondocs in database? Pin
Jassim Rahma2-Mar-12 7:00
Jassim Rahma2-Mar-12 7:00 
AnswerRe: docs in database? Pin
thatraja2-Mar-12 7:45
professionalthatraja2-Mar-12 7:45 
QuestionAccess to the path '' is denied Pin
Sebastian T Xavier1-Mar-12 22:21
Sebastian T Xavier1-Mar-12 22:21 
Hello All,

I was testing a simple program to upload files to sever , but it failed with the following error message. "Access to the path '' is denied" I am using .Net Framework 3.5 in windows 7 machine. The code i have used is given below.

C#
private void cmdSend_Click(object sender, System.EventArgs e)
    {
        // Check to see if file was uploaded
        if (filMyFile.PostedFile != null)
        {
            // Get a reference to PostedFile object
            HttpPostedFile myFile = filMyFile.PostedFile;
            int nFileLen = myFile.ContentLength;
            if (nFileLen > 0)
            {
                byte[] myData = new byte[nFileLen];
                myFile.InputStream.Read(myData, 0, nFileLen);
                string strFilename = Path.GetFileName(myFile.FileName);
                //WriteToFile(Server.MapPath(strFilename), ref myData);//WORKING
                //WriteToFile(@"\\192.168.1.127\Temp", ref myData);//NOT WORKING
                WriteToFile(@"D:\Temp", ref myData);//NOT WORKING
            }
        }
    }

private void WriteToFile(string strPath, ref byte[] Buffer)
    {
         FileStream newFile = new FileStream(strPath, FileMode.Create);
         newFile.Write(Buffer, 0, Buffer.Length);
         newFile.Close();
    }


Can someone help me?

Thanks in Advance...

Sebastian
AnswerRe: Access to the path '' is denied Pin
R. Giskard Reventlov2-Mar-12 8:44
R. Giskard Reventlov2-Mar-12 8:44 
AnswerRe: Access to the path '' is denied Pin
thatraja2-Mar-12 20:48
professionalthatraja2-Mar-12 20:48 
Questiondeploy a webproject in iis 7.5 Pin
suresh kumar behera1-Mar-12 19:14
suresh kumar behera1-Mar-12 19:14 
AnswerRe: deploy a webproject in iis 7.5 Pin
thatraja2-Mar-12 7:33
professionalthatraja2-Mar-12 7:33 
QuestionDB Call in ,net Pin
byka1-Mar-12 9:31
byka1-Mar-12 9:31 
AnswerRe: DB Call in ,net Pin
Not Active1-Mar-12 15:04
mentorNot Active1-Mar-12 15:04 
GeneralRe: DB Call in ,net Pin
byka2-Mar-12 3:00
byka2-Mar-12 3:00 
GeneralRe: DB Call in ,net Pin
Not Active2-Mar-12 5:54
mentorNot Active2-Mar-12 5:54 
GeneralRe: DB Call in ,net Pin
fjdiewornncalwe2-Mar-12 3:12
professionalfjdiewornncalwe2-Mar-12 3:12 
GeneralRe: DB Call in ,net Pin
byka2-Mar-12 4:00
byka2-Mar-12 4:00 
GeneralRe: DB Call in ,net Pin
Ali Al Omairi(Abu AlHassan)5-Mar-12 0:55
professionalAli Al Omairi(Abu AlHassan)5-Mar-12 0:55 
GeneralRe: DB Call in ,net Pin
fjdiewornncalwe5-Mar-12 5:06
professionalfjdiewornncalwe5-Mar-12 5:06 
QuestionSensex Integration Pin
Vijay150129-Feb-12 23:22
Vijay150129-Feb-12 23:22 
AnswerRe: Sensex Integration Pin
Richard MacCutchan1-Mar-12 0:00
mveRichard MacCutchan1-Mar-12 0:00 
AnswerRe: Sensex Integration Pin
Nitin S7-Mar-12 0:55
professionalNitin S7-Mar-12 0:55 
QuestionVertical Method Pin
indian14329-Feb-12 11:34
indian14329-Feb-12 11:34 
AnswerRe: Vertical Method Pin
R. Giskard Reventlov29-Feb-12 11:51
R. Giskard Reventlov29-Feb-12 11:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.