complete File path in fileupload is not showing in mozilla...plzz help

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2008
Posts: 6
Reputation: pranabmohanty is an unknown quantity at this point 
Solved Threads: 0
pranabmohanty pranabmohanty is offline Offline
Newbie Poster

complete File path in fileupload is not showing in mozilla...plzz help

 
0
  #1
Jun 5th, 2008
hello everyone.,
i m new to asp.net. i am using fileupload control in my project. i want the complete file path...in IE i am getting the complete file path but not in Mozilla....in mozilla i am getting the file name only i.e. myfile.xls.......but i want the complete file path i.e. c:\abc/xyz/myfile.xls.
i know because of security mozilla dont show the complete file path....but i need a way to show the file path completely........

i am using asp.net and C#....

its urgent.....plz help.........

thanx in advance......
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 10
Reputation: JackyGZ is an unknown quantity at this point 
Solved Threads: 1
JackyGZ JackyGZ is offline Offline
Newbie Poster

Re: complete File path in fileupload is not showing in mozilla...plzz help

 
0
  #2
Jun 5th, 2008
Try to retrieve the Full path with - FileUpload.PostedFile.FileName

check out these 2 links:
http://www.wrox.com/WileyCDA/Section/id-292158.html
http://www.c-sharpcorner.com/UploadF...7-a64a09b0ee6b
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 6
Reputation: pranabmohanty is an unknown quantity at this point 
Solved Threads: 0
pranabmohanty pranabmohanty is offline Offline
Newbie Poster

Re: complete File path in fileupload is not showing in mozilla...plzz help

 
0
  #3
Jun 5th, 2008
i have done it using FileUpload.PostedFile.FileName .... but the problem is everything is working fine in IE ....but not in mozilla.......actually i want to get the full path of the selected file...not the file name only..........

actually my intension is to read the file path and then reading an excel file and finally save it in data base.......

here are some of the code in C# what i have used in my proj....

protected void btnUpload_Click1(object sender, EventArgs e)
{


String sFileName = FileUpload1.PostedFile.FileName;
String sFIlePath = FileUpload1.FileName;



// Code to read excel file

string strConn;
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sFileName + ";Extended Properties=Excel 8.0;";
OleDbDataAdapter myCommand = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", strConn);
DataSet myDataSet = new DataSet();
myCommand.Fill(myDataSet, "ExcelInfo");

//Data base connection

OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("db4iquad/iquad.mdb") + ";");
conn.Open();
for (int i = 0; i < myDataSet.Tables["ExcelInfo"].Rows.Count; i++)
{
OleDbCommand ocAccess = new OleDbCommand("INSERT INTO iqua (name,age) VALUES " +
"('" + myDataSet.Tables["ExcelInfo"].Rows[i][0] + "'," + myDataSet.Tables["ExcelInfo"].Rows[i][1] + ")", conn);
ocAccess.ExecuteNonQuery();

}
Response.Write("VALUE STORED");
myCommand.Dispose();
conn.Close();
}



its woking in IE but not in mozilla because of the file path only...plz help.......
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 6
Reputation: pranabmohanty is an unknown quantity at this point 
Solved Threads: 0
pranabmohanty pranabmohanty is offline Offline
Newbie Poster

Re: complete File path in fileupload is not showing in mozilla...plzz help

 
0
  #4
Jun 5th, 2008
Originally Posted by pranabmohanty View Post
i have done it using FileUpload.PostedFile.FileName .... but the problem is everything is working fine in IE ....but not in mozilla.......actually i want to get the full path of the selected file...not the file name only..........

actually my intension is to read the file path and then reading an excel file and finally save it in data base.......

here are some of the code in C# what i have used in my proj....

protected void btnUpload_Click1(object sender, EventArgs e)
{


String sFileName = FileUpload1.PostedFile.FileName;
String sFIlePath = FileUpload1.FileName;



// Code to read excel file

string strConn;
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sFileName + ";Extended Properties=Excel 8.0;";
OleDbDataAdapter myCommand = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", strConn);
DataSet myDataSet = new DataSet();
myCommand.Fill(myDataSet, "ExcelInfo");

//Data base connection

OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("db4iquad/iquad.mdb") + ";");
conn.Open();
for (int i = 0; i < myDataSet.Tables["ExcelInfo"].Rows.Count; i++)
{
OleDbCommand ocAccess = new OleDbCommand("INSERT INTO iqua (name,age) VALUES " +
"('" + myDataSet.Tables["ExcelInfo"].Rows[i][0] + "'," + myDataSet.Tables["ExcelInfo"].Rows[i][1] + ")", conn);
ocAccess.ExecuteNonQuery();

}
Response.Write("VALUE STORED");
myCommand.Dispose();
conn.Close();
}



its woking in IE but not in mozilla because of the file path only...plz help.......

hi,

thanx jacky...i got the solution....u really help me a lot........actually i did everything as per the links given by you....its working........ ....
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1
Reputation: NetUser is an unknown quantity at this point 
Solved Threads: 0
NetUser NetUser is offline Offline
Newbie Poster

Re: complete File path in fileupload is not showing in mozilla...plzz help

 
0
  #5
Aug 2nd, 2008
hi pranabmohanty,

can you tell me how you solved that problem.

Thanks in advance
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC