954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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

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......

pranabmohanty
Newbie Poster
6 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 
JackyGZ
Newbie Poster
10 posts since May 2008
Reputation Points: 10
Solved Threads: 1
 

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.......

pranabmohanty
Newbie Poster
6 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

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........ :)....

pranabmohanty
Newbie Poster
6 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

hi pranabmohanty,

can you tell me how you solved that problem.

Thanks in advance

NetUser
Newbie Poster
1 post since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

Hi pranabmohanty

I have struck in the same problem.
Can u tell me how you solved this problem of getting complete file path in Mozilla

Rahul Rathi

rahulrrathi
Newbie Poster
1 post since Dec 2006
Reputation Points: 10
Solved Threads: 0
 

how you solved this problem of getting complete file path in Mozilla?

in java scrpit?

regards,
Arasan

arasan123
Newbie Poster
1 post since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You