Question

I'm using the EPIServer Webservice to create pages and import files. For every page there should be the PageFiles root folder and under the PageFiles there should be another folder, say Images. So the searchpath is ~/PageFiles/id/file.jpg in the root and ~/PageFiles/id/Images/file.jpg.

I have two content channels. One that puts the files in the root folder and one that should put the files in the images folder. I have them configured like this

  • Virtual root for files = ~/PageFiles/
  • Virtual root for files = ~/PageFiles/Images/

The problem is that when I use the method

ImportFile3("MyContentChannel", all the other params)

only the Page Files folder is created and all files go in this root folder. How do I do if I want EPI to create the Images folder and put the images inside this folder?

Thanks!

EDIT

Even if the Images folder exists the file still end up in the root folder.

EDIT 2, The final solution

Thanks to Dmytro Duk I did this when wanting to put the file in the image folder.

ImportFile("pagefiles", image, false, "185/Images/file.png");

where 185 is the pagefolderid form the page that I have to add myself.

Was it helpful?

Solution

Try to specify relative path in content channel root folder using channelRelativeFilePath parameter of ContentChannelService.ImportFile method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top