spaceEncode

Spaces in file names included in urls must be replaced with "+" or "%20", the latter being hex20 or chr$(32), a space character, else the file will not be found.
If a file name contains spaces, the spaceEncode function replaces them with your choice of "+" or "%20", both being acceptable.

code format="vb" spaceChar$="%20"  ' or "+" fileName$="file name with spaces which need to be replaced.txt" print fileName$ if instr(fileName$,chr$(32),1)<>0 then fileName$=spaceEncode$(fileName$, spaceChar$) end if print fileName$ wait

function spaceEncode$(fv$,sc$) l=len(fv$) p=1 while p<>0 p=instr(fv$,chr$(32),1) if p<>0 then fv$=left$(fv$,p-1)+sc$+mid$(fv$,p+1) wend spaceEncode$=fv$ end function

code