Importing Files From FTP With Changing Dates In The Filename

Created by Jason Carr, Modified on Thu, 14 Mar at 6:35 PM by Jason Carr

In this guide, we're going to show you how to download files from an FTP server that need to be imported into PlayoutONE on the same cart numbers each week.
The files we will be downloading also have dates in the filenames that change each week.

Background

For this example, we are going to download 8 files from a syndicators FTP site. Each week the files become available on a Thursday afternoon. The dates in the filenames are always the date of the coming Saturday. 

PlayoutONE

First of all, we need to create our empty carts in PlayoutONE. For this, we are going to add these files by creating a new UID in the Media Finder. 

  • We are going to set the UIDs to 101-108
  • We are going to set the Type to PreRecorded Programs (We created this new Type within the Type Manager first)
  • We are going to set the Title to PreRecorded Show Segment 1-8

Auto Importer

Next, we need to set up a new Import Profile in Auto Importer. The table below shows the settings we have altered. The rest of the default settings have been left as they are when you create a new Import Profile in Auto Importer.

Setting Tab Value 
Import Name Import Details Pre-Recorded Shows Import 
Import Method Import Details Specific UID 
Import Folder Import Details C:\PlayoutONE\Import\Pre-Recorded Shows  
Preserve Title Options Checked 
Preserve Type Options Checked 
Normalise Options Checked 
Detect If Audio Fades Options Checked 
Set Extro Options Checked 
Set Artist To Overrides %DATE_US% (%TIME_12%) 
Extro Override -25 

FileCopy

Finally, we need to set up a FileCopy Job to download the FTP Files every week to our Auto Import profile. We'd also like to rename the files to our cart numbers set out in the beginning of this document. The table below shows the settings we have altered. The rest of the default settings have been left as they are when you create a new Import Profile in Auto Importer.

Setting Tab Value 
Description Details Pre-Recorded Show Download 
Source Source FTP 
Server Source FTP Server (FTP.server.com)
Port Source 21 
Passive Source Checked 
Username Source user@ftpserver.com 
Password Source FTP Server Password 
Folder Source /FTPShows/TheHits/{yyyyMMdd}
(we are using Date Add here to swap in the date of the folder) 
Multiple Files Source Checked 
DateAdd Source 2 days
(We are setting this value to 2 days because we want to add two days to the date on the folder {yyyyMMdd}. As we download these files on Thursday we need to add 2 days to get Saturday's date.) 
Select Files Source See Below
Auto Importer (Details) Destination Checked 
Destination (Details) Destination Pre-Recorded Shows Import 
Start Time Schedule 04:00 
Days Schedule Thu Checked 

Selecting The Files

These are the main settings however we skipped actually picking which files we want to download. 

Go back to the Source Tab, and click the Select Files button

This is where we now select each file we want to download. To add a new file to download slide the Filename toggle button and use the Magnifying Glass to pick your file. Double-click to select it.

Once selected, if your filename contains dates within it, then you'll need to use Date Add to replace the dates on the fly. For our example, the filename we selected was The Hits 2020-01-02 Part 1.mp3. We've changed this to The Hits {yyyy-MM-dd} Part 1.mp3.

We've set the file to rename to 101.mp3

We've set Date Add to be 2 days (just like we did earlier with the folder)

We then click add, to add this file into the list of files to download and repeat 7 more times. 

Click Save once finished adding your files to download, and then Save again to save the File Copy Job.

Testing

Finally, we can verify we've set up everything correctly by selecting the new FileCopy Job we've created and clicking Run. 

  • We should see that FileCopy download 8 files, rename them and pass them to Auto Importer. Note - we can only manually run this job on a Thursday due to the DateRenaming. If we run this job on a Wednesday, then the Date Rename would insert Friday's date rather than Saturday's.
  • Auto Importer should begin importing the file.
  • PlayoutONE should then show all files on the UIDs 101 - 108 with the Date/Time it imported in the Artist field.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article