0

I want to extract my file ,which is kept in a certain directory on webdav, to local with code.

I was able to create a sample link to download it, but I can't pull it to my local by sending an http get request from within the controller.

Simple Link: https://zzz.salesforce.com/on/demandware.servlet/webdav/Sites/Impex/src/catalog/Task14.xml

When I press this link, it downloads immediately from the browser, but I want to do these operations in the background in the code.

How can I do that?

1
  • 1
    Could you copy the code you already have into your question? Commented Jun 16, 2022 at 12:18

1 Answer 1

0

In a script context, you should be able to access the file via the dw.io namespace classes. You can see the available classes in the documentation for the dw.io namespace.

Note that you cannot access the filesystem from the storefront context. Therefore whatever you want to do with that file must be done within the context of a Job or possibly an OCAPI hook. (I'm not sure on the hook) There is a group of quotas that prevent this from occurring. The list is found here: dw.io quotas. Note that all of the I/O APIs have a Storefront limit of 0.

I'd recommend you check out the FileHelper.js from the job-components library for examples and/or an abstraction layer for you to use. Then I also recommend examining how they built their job steps so you can build a custom one for your needs as it's likely you'll need to build a job of some kind to do what you want to do. See the job steps documentation for more info on how to work with jobs and job steps.

You may also find that the job-components library already offers you what you need to do. I'm not sure because your question was pretty vague.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .