/    Sign up×
Community /Pin to ProfileBookmark

Code 0: Access is Denied on attempted file load?

Was just trying a small script to load a file and while it works if I
run it locally on my own pc if I try and access it on a remote web
server it generates an error code 0: Access is denied in IE:

[CODE]<HTML>
<HEAD>
<SCRIPT LANGUAGE=”JavaScript”>
<!– Begin
function whatFile() {
window.location= ‘file:///’ + document.form1.cmuds.value;
}
// End –>
</script>
</HEAD>

<BODY>

<form name=form1>
<input type=file name=”cmuds”>
<input type=button onClick=”whatFile()” value=”Open File”>
</form>

</BODY>
</HTML>[/CODE]

I am trying to load the same local (text) file in each case. Anyone
know what the problem is and whether I can get round it ?

Thanks

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@felgallApr 24.2005 — Javascript doesn't have access to read local files and so can't load the file to display in the browser window.
Copy linkTweet thisAlerts:
@lxndrauthorApr 24.2005 — Javascript doesn't have access to read local files and so can't load the file to display in the browser window.[/QUOTE]
OK, thanks for the info. Do you know of an alternative way of achieving the same thing?
Copy linkTweet thisAlerts:
@SpectreReturnsApr 25.2005 — First of all, you only need two slashes after "file:". If you're running it on a localhost or active desktop, you can use it to access files, but otherwise, you're out of luck.
×

Success!

Help @lxndr spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...