Hello helpers! I need to provide a simple "Download a file" link on the web page to the users but unable to do it, below are the steps I tried, please help.
Steps:
Created new folder in "Media" and uploaded a file. Post uploading it shows link as "/media/6492/file.pgn".
In webpage, created hyperlink with href as "/media/6492/file.pgn" and save.
Go to the url (its valid) and click on #2 link and it shows: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
I went back and checked "file.pgn" in "Media" folder and it exists with the same link.
Hello Alex, thanks for quick response, unfortunately our file extensions are ".pgn" only. But does that mean that it is impossible to implement download link for PGN files in Umbraco?
Hello Alex, I just know how to reach to the backend umbraco web page, is there any guidelines/steps which can help me in updating web.config or iis settings?
That is another dilemma, how to update the file in say DEV enviornment? Do you mean perform GIT clone to local, update the file, and push it to remote or else there is any other easy way?
Sorry I am not umbraco expert and only knows about back office web pages.
Download (any) file from Umbraco website page
Hello helpers! I need to provide a simple "Download a file" link on the web page to the users but unable to do it, below are the steps I tried, please help.
Steps:
Created new folder in "Media" and uploaded a file. Post uploading it shows link as "/media/6492/file.pgn".
In webpage, created hyperlink with href as "/media/6492/file.pgn" and save.
Go to the url (its valid) and click on #2 link and it shows: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
I went back and checked "file.pgn" in "Media" folder and it exists with the same link.
Thanks a lot for helping (in advance)!
Hi Nikhil,
"/media/6492/file.pgn" - are you sure that .pgn is right extention of file?
I'm sure that ".pgn" format isn't supported by IIS.
Thanks,
Alex
Hello Alex, thanks for quick response, unfortunately our file extensions are ".pgn" only. But does that mean that it is impossible to implement download link for PGN files in Umbraco?
It means that we have to add .pgn extention as static content to web.config or iis settings.
Read more:
https://www.iis.net/configreference/system.webserver/staticcontent/mimemap
Hello Alex, I just know how to reach to the backend umbraco web page, is there any guidelines/steps which can help me in updating web.config or iis settings?
I am not a .NET guy.
Nikhil, no problem.
Just open web.config file and go to the "staticContent" section and add this row:
Thanks,
Alex
Ask, please, if something not clear.
Oleksandr
My file extension is PGN, and your code says image/PNG.
PGN is a kind of text file.
On other hand, you have mentioned to update the config file, do you mean perform GIT clone to local, update the file, and push it to remote?
Nikhil, if your file extention is png, why did you ask at the begin of this topic about hyperlink with "/media/6492/file.pgn" href?
PGN is a kind of image file.
If you have png file - you have not change config. It should work like "/media/6492/file.png"
Thanks,
Alex
My bad, updated my existing comment a minute ago:
My file extension is PGN, and your code says image/PNG.
PGN is a kind of text file.
On other hand, you have mentioned to update the config file, do you mean perform GIT clone to local, update the file, and push it to remote?
Nikhil, than you need this line:
Hope it will solve your problem.
Thanks,
Alex
On other hand, you have mentioned to update the config file, do you mean perform GIT clone to local, update the file, and push it to remote?
You have to update config file on the server, local or dev or live, don't know how many environments do you have.
Thanks,
Alex
That is another dilemma, how to update the file in say DEV enviornment? Do you mean perform GIT clone to local, update the file, and push it to remote or else there is any other easy way?
Sorry I am not umbraco expert and only knows about back office web pages.
Of course you need to pull, update and push to remore repo.
But I don't know where is your site hosting?
Do you have access to web site files?
FTP or RDP?
Thanks,
Alex
Just have GIT, I will try to pull, update and push and let you know.
Excellent, it worked Alex, you are genius!
is working on a reply...