Click here to Skip to main content
15,885,309 members
Posted
Updated 11-Jul-20 8:05am
Comments
Richard MacCutchan 11-Jul-20 11:31am    
You are not allowed to access client drives from the browser. It would be a security breach.
TCS54321 11-Jul-20 11:48am    
i am using my own computer local drive. and set read write permission to everyone. but same error i got it.
Richard MacCutchan 11-Jul-20 12:04pm    
It does not matter which computer you are using. Accessing local drives from browsers is not permitted. Ever.

Your website doesn't run under your user account on the web server - it runs under an account specifically set up for the web server software - IIS, probably.
Unless that user has been given access to the relevant parts of the D: drive - and it isn't given anything more than it absolutely needs in order to run for security reasons - it won't be able to access any files on it, read or write.

Additionally, there is no guarantee that when you release the website, the computer will even have a D: drive, much less that IIS will have access to it. You very definitely should not be hard coding file paths - that's why "~/..." works: the "~" indicates to IIS the home folder for that website and needs to be mapped to give a "real" file location.
 
Share this answer
 
Comments
TCS54321 11-Jul-20 12:14pm    
basically i host 2 website on a same server. and i need to download a file that place inside a folder of my 1st website by using of my 2nd website. could you suggest me how can i do it.
You can't.

Code running on the server has no access to the client machines resources, like the file system.

Javascript running in the browser, and any HTML, also has no access to the client machine resources, like the file system.

You have to upload the file to the web server in order to use it.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900