Nel mio sito ho messo questo script di upload per uploadare delle foto:

codice:
 
[...]
 Response.Expires=0
  Response.Buffer = TRUE
  Response.Clear
  byteCount = Request.TotalBytes
  RequestBin = Request.BinaryRead(byteCount)
  Dim UploadRequest
  Set UploadRequest = CreateObject("Scripting.Dictionary")
  BuildUploadRequest  RequestBin
  contentType = UploadRequest.Item("blob").Item("ContentType")
  filepathname = UploadRequest.Item("blob").Item("FileName")
  filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\"))
  value = UploadRequest.Item("blob").Item("Value")

  'Create FileSytemObject Component
  Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")

  'Create and Write to a File
  pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14
  Set objFso = Server.createObject("Scripting.FileSystemObject")
  If not objFso.FolderExists (StrNewFolder) Then
  	objFso.createFolder(strNewFolder)
 end if
  
  Set Myfile = ScriptObject.CreateTextFile(Left(Server.mappath(Request.ServerVariables("PATH_INFO")),pathEnd) & "\public\foto\" & Session("Pmod_Codice_ins") & "_" & SEssion("Prgannuncio") & "\" &  filename)

 ' Set MyFile = ScriptObject.CreateTextFile("StrNewFolder" & Session("Pmod_Codice_ins") & "_" & SEssion("Prgannuncio") & "_" &  filename)
  
  For i = 1 to LenB(value)
	MyFile.Write chr(AscB(MidB(value,i,1)))
  Next
[...]
(devo postare anche l'upload.asp?)

ed uno script per visualizzare le foto in un pop-up preso da un link che ho trovato in questo forum (se volete ve lo posto).

Il mio problema è questo:
se uploado una foto che all'interno del suo nome ha uno spazio, questa poi non viene visualizzata nel pop-up.

Come faccio a fare in modo che in fase di upload mi vengano rimpiazzati gli spazi?