Skip to main content
Question

Filecopy unwanted backward slash to forward slash conversion


Forum|alt.badge.img

 

 

I am trying to use file copy to copy data from a ftp site to network location. For some reasons the backword slashes gets converted to forward slash. Can anyone help to get around it?

 

Thanks :)

9 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • March 10, 2015
Looks more like double slashes get converted to single.

 

Is this fme2015?

 

Are you using a concatenation in the creator or reffering to parameters?

 

Use "Show Summary Annotation"

Forum|alt.badge.img
  • Author
  • March 10, 2015
Yes, this is FME 2015. Creator is just blank. 

 

 

Summary annotation shows this:

 

AttributeCreator_4 [AttributeCreator]

 

filecopy_source_dataset = ftp://<user>:<password>@<url>/<fileName.ext>

 

=======

 

Writer Type: File Copy

 

Feature Type: filecopy

 

Dataset: test [FILECOPY]

 

Geometry: All

 

 

Attributes:

 

filecopy_source_dataset: char(512)

 

filecopy_dest_dataset: char(512)

 

filecopy_dest_filename: char(128)

 

filecopy_source_dataset: char(512)

 

 

=============

 

 

Thank you for your help!

david_r
Celebrity
  • March 11, 2015
Hi,

 

 

URLs should not use backslashes. Try using forward slashes (/) rather than backslashes (\\).

 

 

David

Forum|alt.badge.img
  • Author
  • March 11, 2015
Yes, I have tried forward slash and backslash both. I have also tried 4 slashes but that didn't help. It gives the same error. 

 

It appears to be a bug in FME 2015. If anyone has any suggestion to get past it then that would really help. 

Forum|alt.badge.img
  • Author
  • March 11, 2015
Gio,

 

Thank you for your help! That was a great idea. However, that didn't work! I tried 8 slashes (forward and backward). 

 

 

It takes it properly but then in the next line it removes the slash:

 

 

File Copy Writer: Received copy request from 'ftp:\\\\\\\\<user>:<pwd>\\<fileext>' to 'C:\\Users\\xyz\\AppData\\Local\\Temp\\_auto_zip_dataset_1426095001167_7104\\'

 

 

File Copy Writer: Feature contains an invalid source dataset 'ftp:\\<user>:<pwd>\\<fileext>'. No file operations will be performed for this feature

 

 

 

Thanks!

 

 

 

takashi
Influencer
  • March 12, 2015
Hi,

 

 

Looks like the File Copy writer assumes that source and destination datasets are located on the same disk operating system as the running machine. I guess that's why the writer has changed slashes to backslashes implicitly when running on the Windows.

 

If my observation was correct, it could be difficult to copy files from ftp site to other disk system through the writer running on the Windows.

 

Maybe it's better to request Safe's support...

 

 

Takashi

sigtill
Supporter
Forum|alt.badge.img+24
  • Supporter
  • March 12, 2015
Can you use the transformer FTPCaller on FME2015, or are you using FME2014?

Forum|alt.badge.img
  • Author
  • March 12, 2015
Thanks Takashi and SigTill.

 

I opened a ticket with FME to see if they have a solution. 

 

 

Meanwhile, a combination of using FMECaller, AttributeCreator and FileCopy does the trick. While FMECaller can directly copy to a network location, I need it zipped and that's why I had to use FileCopy transformer.

 

 

I am going to mark SigTill's answer as best answer as it provides a good workaround. 

 

 

Thanks :)

rey
Contributor
Forum|alt.badge.img+2
  • Contributor
  • May 8, 2015
I tried using the FTPCaller but I can't seem to read the files in the ftp server.  Has anyone experienced the same thing?  

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings