FireFox file full path – Security Issue

when you use the file upload using either ASP:FileUpload or html input control which is a type of file, FireFox doesn’t give you the full path of the selected file. For this purpose i have used both the controls as mentioned below

    <asp:FileUpload ID="fleUpLd" runat="server" />

<
input type="button" id="btnDD" value="File - Upload " />

Now that I’ve used both, i tried to get the full path of the selected file. Well, you’ll get the full path of the selected file, when this page is viewed in IE, but not in FireFox. I did a full search on net for getting the full path of the file, but my search went in vain.


There are many snippets that did some attempt to show case the full file path. some thing like, using the onchange event with the help of this.value , but that would also show  you only the file name when fired in FF. The code is some thing like the below

<input type="file" name="upload1" id="upload" onchange="alert(this.value);" />

According to FireFox at this link, they are considering this requirement as a security breach and made it clear that their browser has over come the security breach by not showing the client-side full path of the file. In their words,



..the entire path of the file was available to the web application. This privacy concern has been resolved in FireFox 3 ..


Hence, there is no possibility of showing the entire path of the file what was ready for file upload. Honestly, I didn’t like this. To get the full path of the file that is ready for upload, the developer has to write a custom control, which is reinventing the wheel.


What do you say?


I just read from one of the blogs at weblogs.asp.net about this. Thought it is interesting to read the way the author presented the issue at this link. Did you like it? And here is the bug ticket for Mozilla. This has full details of why and how .. blah .. blah..

Comments

Popular posts from this blog

Network Intrusion Detection using Supervised ML technique

Common mistakes by Interviewer

Keep the system active, to avoid the auto lock