[Extension FtpWebRequest] ftp File rename

[Extension FtpWebRequest] ftp File rename

  
Forge Component
(4)
Published on 28 Jun by André Siébra
4 votes
Published on 28 Jun by André Siébra
Hello,

Is it possible with FTPExtension to rename a file on the remote server?
For Example I have an XML file , but first I want to transfer it as file.tmp file.
Only when all data is tranferred, I wil rename it to file.xml , to prevent locking issues when the remote site tries to read my file before I have closed it.

Cheers,
Patrice
Hi patrice,

Sure you can do that, as you said first transfer all the data and after that Use - SendDataCommand Action
and you can rename and move the same file to different location.

Regards,
Manish Jawla

Manish Jawla wrote:
Hi patrice,

Sure you can do that, as you said first transfer all the data and after that Use - SendDataCommand Action
and you can rename and move the same file to different location.

Regards,
Manish Jawla
 
 
 Thank you for your response.
How do I fill the SendDataCommand parameters then?
Host,user,password I get, but what do I set in the 'Data' parameter and what in the 'Filename'?
(I suppose in 'Filename' is the new name, but what about 'Data'?

Cheers,
Patrice
Hi patrice,

plz find the attachment.
Thanks,
MJ

Almost there, but I need more clues ;)

What is ReceiveDataCommand.Data in this case?
Looks like a structure, but there is no such structure defined in the extention.
Or is is an Action?
How do I set the 'rename' statement?
Mind you, I'm doing a 'PUT' first (SendDataCommand)  en then I want to 'rename file.tmp file.xml' 

Cheers,
Patrice

Hi,

Please find the attachment, i hope this will help u.
ReceiveDataCommand- is used to read the ftp file.

Regards,
MJ

Ok I see what you are doing here , but this is not the rename I want.
You just download the file, rename it an then upload.
But I need REMOTE ftp rename. So after the upload, give it another name ON the remote host.
This function is clearly not in the extention , so I will have to find my way around this.
Thanks for the info.
Hi Patrice,

I've just published a new version of the component with a new action to rename a remote file. I could not test this properly yet, so I ask you to test it and verify if everything is working fine and report any issues you may find. Anyway, you can take a look at the funcion in the extension to get a good starting point to achieve what you need.

Cheers,
André Siébra.
André,

thanks for your response and quick solution.
I was thinking in about the same direction, only with from- and to- filename parameters.
See the attachment source, it works for me.

Cheers,
Patrice
Patrice Oostermeyer wrote:
André,

thanks for your response and quick solution.
I was thinking in about the same direction, only with from- and to- filename parameters.
See the attachment source, it works for me.

Cheers,
Patrice
 Hi Patrice,

Thanks for the suggestion. I'll make this changes to the next version and publish it soon.

Thank you for the feedback!

Cheers,
André Siébra