I have files that I upload to a website that may contain spaces, such as:
file name 1.wav
It usually displays when downloading, but when I try to download a file from Chrome and Firefox, I get the following results:
Chrome downloaded: file name 1.wav (perfect) firefox downloaded: file (bad)
name 1.wav removed from name. Are there any specific functions in PHP that will fix this problem in firefox?
CODE:
<?= str_replace(array("'",'"'), array("'","""), stripslashes($sFileTitle)) ?>', '<?=$f['fileExtension']?>'
This is what appears when I check the element on the anchor tag where the file should be loaded:
<a title="file name 1.wav" fileid="254" class="docLink">file name 1.wav</a>
I am using jQuery to redirect to the correct path.
FIX:
Adding urlencode ($ file) is fixed, but a new problem has occurred. Now file named
file name 1.wav
turns on at boot time:
file+name+1.wav
Is it possible to replace + space after loading? urldecode did not work
Decision:
if someone else having the same problem is how I fixed it:
instead of urlencode / decode I just did this:
'"' . stripslashes($file) . '"'
and he fixed it
source share