"+" sign in path gets converted to space
The code snippet below works just fine until my file path contains a "+" symbol, whereupon, when it reaches Download.php it has been converted into a space
$('#ViewPdf').on('click', function() {
var file = $('#PdfPath').val();
if(file) {
$(location).prop('href', 'Download.php?DeleteTarget&download_file='+file);
}
else { alert('No pdf file so cannot view'); }
});
I am unsure whether the problem is a JavaScript one or php. Some sort of escaping or character conversion looks to be necessary but I am unsure what.