I am generating PDFs and emailing it to users , on my website dynamically using FPDF. But the name of the PDFs generated contains slashes and plus signs ( + , / , \ , [ , ] ) etc. due to which the following error occurs :
fopen:( Unable to find the file or directory )
as soon as I remove the slashes and braces , the PDF is generated successfully and emailed too.
Need a solution to deal with the file-names?
The filenames are created dynamically , so it is not in my hand to change them ? So I think I need to first strip off all those special characters from the PDF file name and then send it to FPDF output. But how to do this ?
You can
urlencode:But then you get strange chars.
Or you just can strip and leave allowed chars