I'm using pdf Js to preview my pdf file, but I want to add a parameter tokenStr after my pdf url, but this does not take effect.
This is my pdf url :
https://127.0.0.1:8080/download/attach/myPDFtest.pdf&tokenStr=N8iSQrfVqmazjQDlyiSd8sNzna0HQ7YWYQHgdj3oq9vHyr
The tokenStr is set for file security and login free.
This is my pdf.js url :
https://127.0.0.1:8080/trd/pdf/0/viewer.html?title=myPDFtest&file=download/attach/myPDFtest.pdf&tokenStr=N8iSQrfVqmazjQDlyiSd8sNzna0HQ7YWYQHgdj3oq9vHyr
However, it does not take the tokenStr parameter as a part of the file, which leads to always https://127.0.0.1:8080/download/attach/myPDFtest.pdf
get files.
I tried to encode the file with encodeURIComponent (), https://127.0.0.1:8080/trd/pdf/0/viewer.html?title=download%2Fattach%2FmyPDFtest.pdf%26tokenStr%3DN8iSQrfVqmazjQDlyiSd8sNzna0HQ7YWYQHgdj3oq9vHyr
, but it still doesn't work.
What should I do to let pdf. js go https://127.0.0.1:8080/download/attach/myPDFtest.pdf&tokenStr=N8iSQrfVqmazjQDlyiSd8sNzna0HQ7YWYQHgdj3oq9vHyr
get My Files