MBS Curl SFTP rename?

This is probably very simple, but can I change the destination file name when uploading?

Right now I’m using upl.OptionURL= destUrl from the examples, but instead of overwriting the file I need to number (increment) my uploads…

Nevermind. Feel free to delete!

The question was:

[quote]This is probably very simple, but can I change the destination file name when uploading?

Right now I’m using upl.OptionURL= destUrl from the examples, but instead of overwriting the file I need to number (increment) my uploads…[/quote]

The answer is to put the new name in the URL.

PS: Please don’t delete the question, but post the answer for others.

Well, I never found out how to rename, but the destUrl is for naming the destination of course. Which ‘solved’ my problem.

Got lost in my own methods…

Don’t know if this is really related and the correct answer, but i am simply renaming files via MBS CURLs like this:

[code]Private Function RenameFTP(AlterDateiname As String, NeuerDateiname As String) as Boolean
NeuerDateiname = CleanupNameForFTP(NeuerDateiname)

Dim e As Integer
Dim d As New RenameCURL

d.OptionUsername = FTPLogin
d.OptionPassword = FTPPassword
d.OptionURL=“ftp://” + FTPServerAdress
d.OptionVerbose = True
d.OptionDirListOnly = True

Dim ws() As String
ws.Append "RNFR "+ FTPCurrentPath + AlterDateiname
ws.Append "RNTO "+ FTPCurrentPath + NeuerDateiname

d.SetOptionPostQuote(ws)

e=d.Perform

If e=0 Then // 0=Alles i.O., 21=Datei existiert bereits

Ergebnis = "0"
Return True

End If

Return False

End Function
[/code]

@Sascha S this is for FTP.
For SFTP you need to use custom request or quote commands to use “rename” command.

[quote=459981:@Christian Schmitz]@Sascha S this is for FTP.
For SFTP you need to use custom request or quote commands to use “rename” command.[/quote]

Ah! Thank you :slight_smile: