We help IT Professionals succeed at work.

access folder out side the virtual path on server in javascript

Saroj13
Saroj13 asked
on
Hello,

I have folder having javascript files outside of the virtual path on the server. I dont want to hardcode the url/ or the folder path.

I need to access the folder in <a href..> How this can be done in javascript?

Thanks
Comment
Watch Question

Chinmay PatelChief Technology Ninja
Distinguished Expert 2019

Commented:
Hi Saroj13,
Unless and until you configure your path to be covered under a virtual directory your end user will never ever be able to access to that path unless and until you are making an intranet portal and your scripts are on a shared folder. If you are making a site that is going to be hosted on a public facing web site than there is no way we can achieve this.
Regards,
Chinmay


Author

Commented:
I have web application like test. So Test is my virtual directory. Test application is using some banner fiiles located on the d drive outside the virtual directory. Test application access files using < a href="...
How I can do that.
Chinmay PatelChief Technology Ninja
Distinguished Expert 2019

Commented:
See if you are developing this application for your own usage then and only it will work, 'cause how other users will access those files which are on your D drive? are you going to host the application?
Fixer of Problems
Most Valuable Expert 2014
Commented:
If this is an internet application for a web site, it is totally against the security rules for web servers to allow access outside the web root.  You need to move the banner files to be able to use them on a web page.
You cannot access the server folder from javascript.

You need to invoke a servlet or other server side script to do the same.