Click here to Skip to main content
15,907,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am working on asp.net 2005. I want to open some files (jpg,txt, pdf) from local machine . I write following code for that.


response.redirect("d:\\rp.png");


In IE : Error is : Permission Denied

In FireFox Error is :
Firefox doesn't know how to open this address, because the protocol (d) isn't associated with any program.


Any help pl.


Regards,


Hardik Shah.
Posted

First of all it is what it is: Permission denied. Your D drive does not have the permission for IUSR_YourMashineName account.

Second: this is the wrong way to handle what you want to do.
Place the file inside your application (say on the root folder) and run
Response.Redirect("/rp.png");

Then it will work.
 
Share this answer
 
Response.Redirect(System.IO.Path.Combine(Request.PhysicalApplicationPath, "rp.png"));
 
Share this answer
 

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