Expand my Community achievements bar.

SOLVED

How to inspect a file downloaded to Adobe Campaign Classic Server

Avatar

Level 7

Hello, I have done a workflow that downloads from an explicit URL, the download works, but i would like to see that file in a file explorer. How can I do it? (I have a hosted deployment mode)

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @Heku_ ,

You can use the File Transfer activity to download a file from an explicit URL and store it on your server. After the download is complete, you can use a Script activity to move the file to a specified location on your server.

Here are the steps to achieve this:

  1. Add a File Transfer activity to your workflow, and configure it to download the file from the explicit URL.
  2. Add a Script activity to your workflow after the File Transfer activity.
  3. In the Script activity, write a script that moves the downloaded file to the desired location on your server.

Here is an example that moves a file from the default download folder to a specified folder:

// Get the default download folder

var downloadFolder = xtks.downloadFolder;

// Get the name of the downloaded file

var fileName = workflowCtx.vars.filetransfer.filename;

// Set the destination folder

var destinationFolder = "C:/MyFolder/";

// Move the file to the destination folder

xtk.fs.move(downloadFolder + fileName, destinationFolder + fileName);

Note that the script assumes that the downloaded file is in the default download folder, stored in the xtks.downloadFolder variable. If you have configured a different download folder in your File Transfer activity, you will need to modify the script accordingly.

Also, make sure that the file destination folder exists and that the user running the workflow has permission to write to it.

Once you have added and configured the Script activity, you can save and run your workflow. After it has finished running, the downloaded file should be in the specified file explorer location.

View solution in original post

3 Replies

Avatar

Correct answer by
Employee Advisor

Hi @Heku_ ,

You can use the File Transfer activity to download a file from an explicit URL and store it on your server. After the download is complete, you can use a Script activity to move the file to a specified location on your server.

Here are the steps to achieve this:

  1. Add a File Transfer activity to your workflow, and configure it to download the file from the explicit URL.
  2. Add a Script activity to your workflow after the File Transfer activity.
  3. In the Script activity, write a script that moves the downloaded file to the desired location on your server.

Here is an example that moves a file from the default download folder to a specified folder:

// Get the default download folder

var downloadFolder = xtks.downloadFolder;

// Get the name of the downloaded file

var fileName = workflowCtx.vars.filetransfer.filename;

// Set the destination folder

var destinationFolder = "C:/MyFolder/";

// Move the file to the destination folder

xtk.fs.move(downloadFolder + fileName, destinationFolder + fileName);

Note that the script assumes that the downloaded file is in the default download folder, stored in the xtks.downloadFolder variable. If you have configured a different download folder in your File Transfer activity, you will need to modify the script accordingly.

Also, make sure that the file destination folder exists and that the user running the workflow has permission to write to it.

Once you have added and configured the Script activity, you can save and run your workflow. After it has finished running, the downloaded file should be in the specified file explorer location.

Avatar

Level 7

Hello, thank you for your reply. I understand all the steps, but what file explorer should I use to access the file? (I have a hosted deployment mode)

Avatar

Employee Advisor

Hi @Heku_,

To access the file, you can check the below:

  1. Remote File Access Protocols: Some hosting services may support remote file access protocols such as FTP (File Transfer Protocol), SFTP (Secure File Transfer Protocol), or SMB (Server Message Block), which allow you to access files on your hosted deployment from your local machine using a separate file explorer software that supports these protocols.
  2. Command-Line Interface (CLI) or Terminal: If you have command-line access to your hosted deployment, you can use CLI commands or terminal commands to navigate and manage files. This typically involves using commands such as ls, cd, cp, mv, rm, etc., depending on the operating system and hosting environment you are using.

The specific file explorer or method for accessing files in your hosted deployment would depend on your hosting environment and the options provided by your hosting service.