get file path in mozila

Asked By bretto kumar A
23-Dec-08 04:19 AM
Earn up to 0 extra points for answering this tough question.

hai

string str = Path.GetFullPath(FileUpload1.PostedFile.FileName);

im using the above code ib my application to get the upload file path.

this code is perfectly work in IE

but it dosen't work in Mozilla

in mozilla it get and display path like

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\hhvB4.tmp.jpg

this

but my image path is C:\Documents and Settings\acibre.ACIINDIA\Desktop\hhvB4.tmp.jpg

how can it solve this problem

please share ur ideas

 

 

 

  READ THIS

C_A P replied to bretto kumar A
23-Dec-08 05:03 AM

When you have to pass in a file path to do some processing with the file, try using the following C# code.

string path = Path.Combine(Environment.CurrentDirectory, @"..\..\TestDeserialization.xml");

Where,

The TestDeserialization.xml file is in the Project root directory.

It helps to avoid confusion in file paths.

Create New Account