943,902 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 10719
  • ASP.NET RSS
Jun 5th, 2008
0

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

Expand Post »
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......
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pranabmohanty is offline Offline
6 posts
since Jun 2008
Jun 5th, 2008
0

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

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
Reputation Points: 10
Solved Threads: 1
Newbie Poster
JackyGZ is offline Offline
10 posts
since May 2008
Jun 5th, 2008
0

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

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.......
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pranabmohanty is offline Offline
6 posts
since Jun 2008
Jun 5th, 2008
0

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

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........ ....
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pranabmohanty is offline Offline
6 posts
since Jun 2008
Aug 2nd, 2008
0

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

hi pranabmohanty,

can you tell me how you solved that problem.

Thanks in advance
Reputation Points: 10
Solved Threads: 0
Newbie Poster
NetUser is offline Offline
1 posts
since Aug 2008
Dec 23rd, 2009
0

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

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rahulrrathi is offline Offline
1 posts
since Dec 2006
Feb 20th, 2010
0
Re: complete File path in fileupload is not showing in mozilla...plzz help
how you solved this problem of getting complete file path in Mozilla?

in java scrpit?

regards,
Arasan
Reputation Points: 10
Solved Threads: 0
Newbie Poster
arasan123 is offline Offline
1 posts
since Feb 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: ASP.NET Registration Page
Next Thread in ASP.NET Forum Timeline: use ToolBarItem Id as ModalPopupExtender TargetControlID





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC