Link for File Download

Hi Experts,

If I have a file at

which is at

My question is, from, how would I write my <a> tag to engage download?

I have <a href="../downloads/myfile.xlsx" target="_blank">, but I am getting Permission Denied.

Thank you

Edit: This may be a Windows Question.
APD TorontoAsked:
Who is Participating?
What sort of permissions do you allow for that file or folder to the type of user that is trying to access it?
What do you get if you browse to
APD TorontoAuthor Commented:
I just need to bring up the Save As window for the user, as you see in any other site.  Example, clicking on a pdf link
APD TorontoAuthor Commented:
Here's a test
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

APD TorontoAuthor Commented:
Clicking on the  file, opens it
Julian HansenCommented:
My question is, from, how would I write my <a> tag to engage download?
You don't write the <a> tag from the perspective of index.php you do it from the perspective of the browser so

<a href="">Download File</a>

Open in new window

APD TorontoAuthor Commented:
That too gives me Access Denied, so does manually pasting this in the url

I just tried giving Full Permissions to IIS_IUSRS for C:/inetpub/wwwroot\\downloads\ and all child objects, and I get

An error occurred while applying security information to:


Access is denied.

I'm using Win 7x 64 Pro, and yes I'm logged in as Admin.

I'll also add Windows to this Question's categories.
Julian HansenCommented:
Hang on, I thought in your OP you said the document can be accessed like this

If you put that in your browser does it work?

If you get access denied then you need to look at the permissions on the folder and make sure you have the right permissions to access the file.

file://c:.... is pointless as this is only accessible on the machine where the file resides.

Step 1.
Can you access the file in the browser like this

Yes - then it will work from the page

No - check the permissions on the folder and alter until Step 1 above gives you access to the file.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.