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

Asked

Viewed 5,155 times

0

I have a folder called userFiles at my root. When the admin opens the screen it sees a list containing the user name and a column with the link to view the file that that user previously uploaded.

That is, I want that when the ADMIN click on the link it can have access to the file.

I’m following what I saw in that post but it’s not working.

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

The link is created but when I clik on top of the link nothing happens.

Someone knows 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 error.

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

I tried to remove tbm the word file and this is the error I’m getting:. inserir a descrição da imagem aqui

UPDATE 2

I found the point of the problem but I do not know how to solve.

This is my code:

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

This line of code works ONLY if I manually place 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 t2.csv file it is passed to the userFiles directory as it should. I copy the HTML code and rename the pata t2.csv file.

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

Here it no longer works and brings up 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 idea?

  • Are your files on the server? The path is really C disk:??

  • So that’s what I saw in the post. I found it strange tbm

  • It’s probably in the post the guy is using on local server, you have to put the path of your file. Try putting type: "/wwwroot/camio_ate_o_file/.csv file", if your file is . csv and if your server has that wwwroot folder, it may vary according to the server. It is the folder that is your site on the server

  • Which error appears?

  • The one I posted in the photo. Check the footer. The last error was Failed server problem. I think you have something with IIS permissions. I just ran another page and got this error: HTTP Error 404.3 - Not Found&#xA;The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

  • Guys I did an update...

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.