Reputation: 5179
In firefox i do get the file name (not the full path from where the file is uploaded) using fileuploadID.postedfile.filename. But the same thing retrieves full path (from where the file is uploaded) in IE.
Any one please tell me how to get the filename browser compatibly.
Upvotes: 0
Views: 5421
Reputation: 4827
Firefox by default sends only the filename. But that should be enough to get the name. Once you get the name, it is enough for you, because it is already uploaded to the temp folder (location is unimportant). Once you have the filename handle, you can copy it wherever. Alternatively, you can use Path.GetFileName(filename)
that should get you the same results in both the browsers....
http://msdn.microsoft.com/en-us/library/system.io.path.getfilename.aspx
Upvotes: 1