Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FtpWebRequest cannot handle file with more than one space
Message
De
27/11/2013 15:53:20
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
FtpWebRequest cannot handle file with more than one space
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01588791
Message ID:
01588791
Vues:
48
I have discovered the FtpWebRequest cannot handle files which contain more than one space consecutive. The following code would fail on the last line if this is the case:
                    ' FTP setup
                    loFtpWebRequest = System.Net.FtpWebRequest.Create(New Uri(lcURI))
                    loFtpWebRequest.Credentials = New System.Net.NetworkCredential(cUsername, cPassword)
                    loFtpWebRequest.Method = System.Net.WebRequestMethods.Ftp.DownloadFile
                    loFtpWebRequest.UseBinary = True
                    loFtpWebRequest.UsePassive = True
                    loFtpWebRequest.KeepAlive = False
                    loFtpWebRequest.Timeout = 10000000
                    loFtpWebRequest.ReadWriteTimeout = 10000000

                    Using loFtpWebResponse As System.Net.FtpWebResponse = loFtpWebRequest.GetResponse()
So, if I have a file name Test File.zip, which contains one space, it is ok. If I add another space between Test and File, this will fail.

The message will be:

"The remote server returned an error: (550) File unavailable (e.g., file not found, no access)."

This seems to be a flaw in that namespace. Anyone has faced that situation before? In that particular situation, I could rename the file before downloading and renaming it after. But, that seems to be quite a detour to achieve this.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform