Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot rename in FTP with .NET Framework 4.0
Message
De
21/07/2010 03:13:54
 
 
À
21/07/2010 02:54:01
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01473268
Message ID:
01473271
Vues:
34
>It seems .NET Framework 4.0 doesn't allow to rename a file with a full directory path. So, we have to only include the file name. This is a major problem. I need to upload into a temporary directory. Then, I need to rename that file so it would appear in the production directory. I cannot upload directly into the production directory as the master file should be running up until the last second before I delete it and rename the temporary file into the production directory. So, basically, before, it was going like this:
>
>1. Upload into Temp\Something.dll
>2. Delete Bin\Something.dll
>3. Rename Temp\Something.dll to Bin\Something.dll
>
>But, now, I can only make the RenameTo to work like this:
>
>1. Upload into Temp\Something.dll
>2. Rename Something.dll to Something2.dll
>
>There is no move command with WebRequestMethods. So, the only way I have found so far to move a file into another directory is to use the RenameTo command. But, this doesn't work anymore and gives 553 File name not allowed.
>
>Anyone would have a suggestion on how to resolve that issue?


I just completed the rename test - yes - only the the file name allowed - not the full path - which makes sense to me

As to the question, you could upload into the production directory with another name

1. Upload to Bin\Something2.dll
2. Delete Bin\Something.dll
3. Rename Bin\Something2.dll to Something.dll
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform