Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot rename in FTP with .NET Framework 4.0
Message
From
21/07/2010 02:06:24
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Cannot rename in FTP with .NET Framework 4.0
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01473268
Message ID:
01473268
Views:
182
I cannot rename a file anymore in FTP with .NET Framework 4.0. Since I recompiled my application, after the upload, when I try to rename the file, I get an error:

(553) File name not allowed

Nothing has changed on the server. I even tried that on a client server. It is the same result. The only factor is that I changed my exe on my local PC.

Here is the code:
            Try

                ' FTP setup
                loFtpWebRequest = System.Net.FtpWebRequest.Create(New Uri(lcURI))
                loFtpWebRequest.Credentials = New System.Net.NetworkCredential(cUsername, cPassword)
                loFtpWebRequest.Method = System.Net.WebRequestMethods.Ftp.Rename

                ' The new name
                loFtpWebRequest.RenameTo = lcURI2

                ' Rename the file
                loFtpWebRequest.GetResponse().Close()

                llSuccess = True
            Catch loError As Exception
                lError = True
                cError = cUnableToRenameTheFile + " " + lcURI + " " + cTo + " " + lcURI2 + "." + _
                 oApp.cCR + oApp.cCR + loError.Message
            End Try
The lcURI is like this:

ftp://something.myserver.com/directory/directory/Temp/Framework.dll

lcURI2 is like this:

directory/directory/Bin/Framework.dll
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
Next
Reply
Map
View

Click here to load this message in the networking platform