How do I create a link to view files on the server?

0

I have a folder called userFiles in my root. When the admin opens the screen he will see a list containing the user name and a column with the link to view the file that that user has previously uploaded.

That is, I want it when ADMIN clicks on the link it can access the file.

I'm following what I saw in this post but it is not working.

<a href="file:///C:\Site1\fileroot\br\userFiles\user1.csv">Arquivo</a>

The link is created but when I click on the link nothing happens.

Does anyone know where I'm going wrong?

UPDATE

Note: I am on a local server, IIS win7. I inserted the download attribute in the tag and it sends me a download but with an error.

<a href="file:///../fileroot/br/userFiles\user1.csv" download>Arquivo</a> 

I've tried removing the word file and the error I'm getting: Server problem.

UPDATE2

IfoundtheproblembutIdonotknowhowtosolveit.

Thisismycode:

<ahref="../fileroot/userFiles/t1.csv" download>Download t1.csv - ok</a>

This line of code works ONLY if I manually put the t1.csv file inside the userFiles directory.

If I make a copy of the file and name t2.csv and then use the site to upload the file t2.csv it is passed to the userFiles directory, as it should. Copy the HTML code and change the name of the file to t2.csv.

<a  href="../fileroot/userFiles/t2.csv" download>Download t2.csv - ok</a>

Here it no longer works and loop the error message you see in the photo: Failed-Server problem.

As if something happened to the file during the upload process (when the user sends it to the server).

Any ideas?

    
asked by anonymous 14.06.2016 / 16:17

0 answers