Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138307

How to remove some prefix from download file path. e.g. http://localhost:XXXX/section-name"

$
0
0

My web app is running on http://localhost:XXXX port number. In that one section, I want to download some files. but it will prefix "http://localhost:XXXX/section_name" in the path of the download file.

<a href={file_path} download={file_name}>
   <Button variant={"link"}>
      <b>Download File</b>
   </Button>
</a>

In the above code, I want to download pdf files. but at click time, it will convert path in the below format.

http://localhost:XXXX/section_name/file_path

I want to remove the "http://localhost:XXXX/section_name" part form download URL.


Viewing all articles
Browse latest Browse all 138307

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>