I have a requirement as a follows. I user AngularJS, JavaScript. 1. User clicks on a document in the browser. I get the document path and open it. >> window.open(documentpath); 2. But the document which is saved in the directory has a file name replaced as Id and NO extensions. abc/files/4 3. The actual filename is in the DB as Id: 4 Filename: Hello.pdf
So when I open the file, I get abc/files/4 which has no format in it and it doesn't open the file.
How can I open the file with the right name abc/files/Hello.pdf?
1st, I want to take the path abc/files/4 and I don't want to download the file. Just store it somewhere locally like cache/Temp to get the file contents and rename 4 to Hello.pdf and then open it in the browser. All this should happen in the background and should open the file correctly when the user clicks on it.
Is it possible using JavaScript, AngularJS? Please let me know