FileUpload full path in firefox 3

I am trying to develop a newsletter system in C# and because of some specific issues I need the full path of the .html file I am sending as a newsletter inline message body.

When I am using FileUploadCntrl.PostedFile.FileName or  FileUploadCntrl.FileName it only gives me the filename without the full path in Firefox, while it works just fine in IE.

I tried a javascript solution (which uses a hidden textbox.text to save the file path and then retrieve it from textbox when I need to use it) I saw somewhere and I have the same results. Javascript I am using like this:

ID="SendBtn" onClientClick="document.getElementById('HiddenTextBox').value = document.getElementById('AttachFileUpload').value" runat="server"...

Still the same result in Firefox.

Anyone ran into this? Anyone has a solution which would work across different browsers?

Thanks in advance!
sabritahiriAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Pravin AsarConnect With a Mentor Principal Systems EngineerCommented:
0
 
b0lsc0ttConnect With a Mentor IT ManagerCommented:
If you need to get this you will have to look at developing something like a Java applet.  They can work in the browser and will have the security access to get that info.  Of course this involves a download (usually really small and easy) by the user and they can disable or refuse the applet but it is a method that would work.  Javascript won't be able to because of browser security, as pointed out by pravinasar above.  If you are stuck with Javascript only (or clientside script) then all credit to him for the answer.
If you have a question about what I have said then let me know.
bol
0
 
sabritahiriAuthor Commented:
There is some kind of solution using javascripting here: http://forums.asp.net/t/1072949.aspx, however none of this worked for me. I am not sure whether I did it right way, but it seems like people in that forum claim that they have a solution using javascript.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
b0lsc0ttIT ManagerCommented:
I may have missed it but that forum seems to say the path was still missing when Firefox 3 was used.  That should be caused by the change (security fix) mentioned in pravinasar's link.  Did you notice the part at the end of the page that was about "File Upload Fields"?  That should be the cause of this and won't be something Javascript can workaround.  If it works in IE now I would not be suprised if it also changes since most would consider that a security hole.
Let me know how this helps or if I missed a specific comment in that other forum you linked to which seemed to provide that info even for FF3.
bol
0
 
Pravin AsarPrincipal Systems EngineerCommented:
Look at the post at the 08-26-2008, 4:56 AM


http://forums.asp.net/t/1072949.aspx

It does not work.

Earlier , I had tried similar approach (using hidden field),

For testing purpose, try the following code in IE and FF




<html>
<HEAD>
<head>
<script type="text/javascript" language="JavaScript">
</script>
</head>
<body>
<form method="post" name="f" enctype="multipart/form-data" onsubmit="return check();">
<p>
<br>
<input type="file" name="pic" size="40" onchange="alert (this.value);">
<p>
Please include a short explanation:<br>
<p>
<input type="submit" value="Send">
</form>
</body>
</html>

Open in new window

0
 
sabritahiriAuthor Commented:
It's my first time posting a question and solution but I feel that this is a fair spread of points (I am not sure how important are the points either).
Nevertheless, thanks a bunch to both of you!
0
 
b0lsc0ttIT ManagerCommented:
I'm glad I could help a bit.  The split seems fine to me.  The other expert provided the main answer.  Thanks for the grade, the points and the fun question.
bol
0
 
Michel PlungjanIT ExpertCommented:
will flash pass the file name?
0
All Courses

From novice to tech pro — start learning today.