By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,780 Members | 1,126 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,780 IT Pros & Developers. It's quick & easy.

Javascript :Access Denied Error

P: 3

I have an HTML form with a browse button for file upload. If in the text I directly type the file name then:
1. If I type full path, e.g d:\abc.pdf, then hitting submit works fine.
2. If I type just the file name, e.g abc.pdf, then hitting submit hangs the browser. Javascript error says : Access denied.
This problem is occuring in IE7. Works fine with firefox. I tried changing the browser setting like this : Tools>Internet Options> Security>Custom Level>Miscellaneous>>Access data source across domain : Prompt. It didnt change anything.

I know what the problem is, but I dont know how to solve this. At least the browser should not hang because of javascript error. I do have backend validation for this file. I just want to escape javascript error.

Jan 23 '08 #1
Share this Question
Share on Google+
6 Replies

Expert 5K+
P: 5,000
Next time try posting in the proper forum, instead of Misc. Questions.
Jan 23 '08 #2

Expert Mod 15k+
P: 16,027
Is the page in the same directory as the file?
Jan 24 '08 #3

P: 3
the page doesnt exist at all.
Even if it does, i get the same error in both case(same directory/different directory).

So in all case, I am getting this same error.
Jan 24 '08 #4

Expert Mod 15k+
P: 16,027
What do you mean, the page doesn't exist? By page, I meant the HTML page containing the input file element.
Jan 25 '08 #5

P: 3
I actually meant the 'file' to be uploaded, not the 'page'.
Jan 25 '08 #6

Expert Mod 15k+
P: 16,027
I can't reproduce this error, but the file name should be selected using the Browse button. You can prevent users from entering into the file input box, if you want.
Jan 28 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.