Click here to Skip to main content
15,942,770 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,


I need to check whether pdf is password protected or not. for that I did like


C#
try
{
    PdfReader pdfReader = new PdfReader(pdfFullname);
    return false;
}
catch (BadPasswordException)
{
    return true;
}


here pdfFullname is coming as test.pdf. but in IE am getting the full path. but in firefox and chrome only file name is coming.
here exception will come as test.pdf not found as file or resource.

please give input for it.
Posted

1 solution

You don't need the full file path from the browser. The file is being uploaded to the server so all you need is the filename. The rest of the path is going to be whatever the path is to the folder where your server side code put the file when it processed the uploads.

No, your code can NOT see the file on the clients machine and can NOT try and load that copy of the file.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900