cancel
Showing results for 
Search instead for 
Did you mean: 

XI File Adapter: Receiver use of variable to create subdirectories issue

Former Member
0 Kudos

Another question for the Guru's

I have a requirement to <b>write</b> a file to the ftp server to directories like:

/dir1/subdir1/out

/dir1/subdir2/out

I can currently use a variable like %var% which I read from the xml payload to determine which directory to write to.

This works: /dir1/<i>%var%</i>/out, assuming that the subdirectory is already created.

The issue that I have is that if the directory does not exist, it will not create it and the related subdirectories based on the variable. I have tried passing in the name of the entire directory and subdirectory path with the same result.

Does XI only create a single directory with the 'create directory' and must that directory be specified at the end of your target path string like

/dir1/<i>%var%</i>

Thanks in advance.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

We changed the OS structure to avoid this issue

henrique_pinto
Active Contributor
0 Kudos

Probably your FTP user doesn't have authorization to create new folders.

Check that in FTP configuration.

Regards,

Henrique.

Former Member
0 Kudos

If I specify the variable name at the end of the directory path it works fine, but when there are additional subdirectories to create, it will not work

var1 = messagetype

If I do

works = /dir1/ALEAUDIT/file

works = /dir1/%var1%/file (this will create the directory and put the file in)

works = /dir1/ALEAUDIT/subdir/file

does not work = /dir1/%var1%/subdir/file (this will NOT create the directory and subdirectory)

I have tried making var1 = messagetype/subdir/ with the same results. When I did this I also checked the security checkbox to allow the /'s.

Former Member
0 Kudos

Marowski,

If the subdirectory also is going to be dynamic then why dont you try with another variable substitution (var2). Then I think it should work.

Regards,

---Satish

henrique_pinto
Active Contributor
0 Kudos

> works = /dir1/ALEAUDIT/file

> works = /dir1/%var1%/file (this will create the

> directory and put the file in)

>

> works = /dir1/ALEAUDIT/subdir/file

> does not work = /dir1/%var1%/subdir/file (this will

> NOT create the directory and subdirectory)

If that's really the case, it sounds like a bug.

Raise an OSS message.

Regards,

Henrique.

Former Member
0 Kudos

Hy, Michael

Yes, XI only create a single directory with the create directory.

You can solve this problem

  • Changing the user connection profile, assigning the default directory as you need

  • Or you can execute an operating system command before message processing, which creates your directory

Former Member
0 Kudos

Marowski,

I havenot tried this. But I think it should be feasible. Give a try by checking the Create target directory check box. Also request your basis guys to give full permissions on the drive. Sometimes you might not have permissions to create. Also see adapter monitoring for any errors. Once when you check all this then give a shot.

Also please update here what happened.

Regards,

---Satish

Former Member
0 Kudos