How to change default folder download in angular

I have a problem while I want to download file from server. I can download only from 192.178.1.1/assets/img/xxx.csv. How to change this path. I want like this: 192.178.1.1/CSV/xxx.csv. Tks for your help !

1 answer

  • answered 2020-09-28 18:43 Mikhail Malakhvei

    let path = []; path = pathString.split('/'); let newPath = path[0]+'/CSV/'+path[path.length-1];