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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pravin AsarPrincipal Systems EngineerCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
b0lsc0ttIT 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
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.