Skip to main content
Solved

How to rename a file when using filecopy to move them to a new location.

  • July 11, 2018
  • 6 replies
  • 331 views

I am reading all JPGs contained in a location (including subfolders) and manipulating the attributes. Then, using the filecopy writer, I am moving them to a new location. I am having a hard time getting them to move with the name I am defining in the Text Editor. The original name is retained every time. Does anyone have some advice for me?

Best answer by jneujens

Just make sure the original input path is in the attribute filecopy_source_dataset. The folder you want to move them to should be the attribute filecopy_dest_dataset. The name of each JPEG can be whatever and should be in the attribute filecopy_dest_filename.

 

 

I recommend using an inspector just before the filecopy writer to verify that this is the case.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • July 11, 2018

Hi @emorris4

You can use the transformer AttributeManager and configure the attribute fme_basename like this image bellow:

Thanks,

Danilo


jneujens
Forum|alt.badge.img
  • Best Answer
  • July 12, 2018

Just make sure the original input path is in the attribute filecopy_source_dataset. The folder you want to move them to should be the attribute filecopy_dest_dataset. The name of each JPEG can be whatever and should be in the attribute filecopy_dest_filename.

 

 

I recommend using an inspector just before the filecopy writer to verify that this is the case.

  • Author
  • July 13, 2018

Thanks for the help!


danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • July 13, 2018

Thanks for the help!

You are wellcome :)

 

 


  • October 20, 2022

I'm struggling exactly with this same issue as the original question is.

I do get the files moved but cannot get the name updated. Having filecopy_dest_filename defined does not make any difference as to me it seems FME version 2022.1 File Copy transformer don't understand filecopy_dest_filename at all!?

imageAs you see, in the File Copy transformer I only get filecopy_source_dataset visible.

I've added those 2 other attributes as well but those won't make any difference.

 

 


dmerrick
Contributor
Forum|alt.badge.img+1
  • Contributor
  • December 1, 2022

I'm struggling exactly with this same issue as the original question is.

I do get the files moved but cannot get the name updated. Having filecopy_dest_filename defined does not make any difference as to me it seems FME version 2022.1 File Copy transformer don't understand filecopy_dest_filename at all!?

imageAs you see, in the File Copy transformer I only get filecopy_source_dataset visible.

I've added those 2 other attributes as well but those won't make any difference.

 

 

@_jami_​  check your warnings, file copy ignores the destination file name if it does not consider the source dataset as a file. I have a workspace that works correctly because it is renaming pdf's, but another that does not work due to trying to rename a geodatabase.