Why does Internet Explorer reject my filename with spaces? -
i have bunch of pdf files have spaces in name displayed in iframe in new window using window.open (not @ same time).
both work fine in except ie8 throws file not found error. remove spaces , work fine in ie8.
i need retain spaces in file names tried using escape(filename); repalces spaces escape key %20. doesn't work either.
i have tried evrything think of or google make ie8 accept spaces, nothing seams work.
any suggestions? can remove spaces testing in real world removing spaces names of pdf files in file system not option.
here code working with
var file = "pdfs/this file name has spaces.pdf"; file = escape(file); //this not fix problem //to display in new window or tab... window.open(file); //to display in iframe... $('.viewer .ifrm').attr('src', file);
thanks.
use encodeuri instead of escape
Comments
Post a Comment