-1

I have a web site that has PDF files to open on antoher tab. These PDF's have Hebrew characters and thus the URL has also Hebrew characters. While developing on Visual Studio I had no problems at all, but after deploying my site on the host, I can't open these url and I get 404 http error page not found. When I change the file name to English character, it all works fine so I guess it's an language/encoding problem. The thing is that I have lots of PDF's and changing their name and url is a lot of work. Is there any way to solve this issue?

Thanks

Nir-Z
  • 669
  • 1
  • 11
  • 26

1 Answers1

1

you can request the PDfs to a page, sending the pdf document name as a base64 encoded value.

Create a page that receives a variable through get or post. Something like:

mydomain.com/PDFDownloader.aspx?document=[BASE64ENCODED]

Where [BASE64ENCODED] is your document name encoded as a base64 string. This way you can decode it on server side, and the URL will open without issues in client browsers, as base64 encoded strings do not have such characters.

Miguel Mesquita Alfaiate
  • 2,361
  • 4
  • 22
  • 50
  • Can you please elaborate? tnx – Nir-Z Sep 24 '15 at 17:14
  • Thanks for the details, but my file name in the server is in non latin characters, when I open it from the server it has to be the same name as the file name and I still get the error. By the way I'm using PHP linux server – Nir-Z Sep 25 '15 at 16:40
  • @Nir-Z I don't understand from your comment if you are having trouble opening the file on server side. Are you saying that PHP can't reach the file due to its name? If that is the issue, make a mapping between the original names and the names without Hebrew characters, and use the non hebrew names to read the file in php. – Miguel Mesquita Alfaiate Sep 25 '15 at 16:59
  • Just notices that the file names in the host's ftp are in gibberish...maybe the host doesn't support utf-8 encoding... – Nir-Z Sep 25 '15 at 17:35
  • Problem solved...was ftp encoding issue...thanks again – Nir-Z Sep 25 '15 at 18:10