Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. FTP command "NLST" gives me "?" instead of "æ", "ø" or "å"

FTP command "NLST" gives me "?" instead of "æ", "ø" or "å"

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thomasa
    wrote on last edited by
    #1

    I've created my own ftp client, and I retrive the files on a folder by using the "NLST" command. This gives me an ArrayList of the filenames in that folder. My problem is that the filenames contains "?" instead of "æ", "ø" or "å". I've set det Transfer Type = "TYPE A" (I've tryed "TYPE E" and "TYPE L", but I only get a return value that this is not implemented, and I don't know how to do this, or if it will solve my problem.) Does anyone know how I can fix this? Thanks in advanced Thomas

    T 1 Reply Last reply
    0
    • T thomasa

      I've created my own ftp client, and I retrive the files on a folder by using the "NLST" command. This gives me an ArrayList of the filenames in that folder. My problem is that the filenames contains "?" instead of "æ", "ø" or "å". I've set det Transfer Type = "TYPE A" (I've tryed "TYPE E" and "TYPE L", but I only get a return value that this is not implemented, and I don't know how to do this, or if it will solve my problem.) Does anyone know how I can fix this? Thanks in advanced Thomas

      T Offline
      T Offline
      thomasa
      wrote on last edited by
      #2

      The problem was in my stream reader bytes = stream.Read(buffer, 0, buffer.Length); strMessage += Encoding.ASCII.GetString(buffer, 0, bytes); replasing it with Encoding.Default.GetString(buffer, 0, bytes); gave me the correct format. But my problem dosen't stop there, for now I wan't the FileSize of the file, this i do by: Byte[] cmdBytes = Encoding.Default.GetBytes(("SIZE Berlinerbolle bringebær.doc"+ "\r\n").ToCharArray()); stream.Write(cmdBytes, 0, cmdBytes.Length); but then I get the "550 Berlinerbolle bringebær.doc: The system cannot find the file specified. ". I've tried different types of encoding but it all returns somewhat the same error. So now the quetsion is how do I sett the Encoding for an ftp site on a windows 2000 server run by IIS?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups