|Keep It Simple, Stupid|
Re: How to Read local CDROM content from web pageby jonadab (Parson)
|on Apr 25, 2008 at 12:02 UTC||Need Help??|
As a general rule, web content is not permitted by the browser to do arbitrary things like that on the user's computer, because if it were, any website you visit could pretty much take over your computer, and that would be bad.
You can use an input element with type="file" to allow the user to select and upload an individual file from their computer. But the user gets to pick the file, and the web server only gets sent the one file they pick. Running Perl code on the server, this is absolutely the closest you can get to what you asked for.
If you explore the possibility of client-side applets that utilize a major plugin (e.g., Java), you may find a loophole through which you can slip part of what you need to do. But I would not be surprised if you run into a brick wall in the form of the security model even there.
Of course, if you write your own plugin, it can do more or less whatever it wants -- *if* the user is willing to install it. Which they almost always will not be. This approach can work in certain special situations, e.g., if you're developing a corporate intranet application and the IT department can deploy the plugin on every workstation in the organization. For a website for general consumption, though, it's not going to fly.
Active-X used to be a gaping wide-open security abdication that would allow this sort of schenanighans to be pulled off on MSIE on Windows (if the user clicked the yes button), but due to the obviously unacceptable security problems that created Microsoft has improved their security model over the last several years and this is really no longer workable. Thank goodness.
However, all of that only answers the question you actually asked. Without more background, I can't say for sure, but it's possible that maybe there's some more feasible way to accomplish what your site really needs, without violating the security barriers that protect users from malicious websites. If you explained more about why your website wants this kind of information, maybe there's another way to accomplish the necessary part of what the site actually needs, a way for your site to provide the actual useful features it wants to provide without reading the user's CD-ROM drive.
We're working on a six-year set of freely redistributable Vacation Bible School materials.