• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Writing into an ftp folder

New Here ,
Jun 06, 2011 Jun 06, 2011

Copy link to clipboard

Copied

I have an application where every change in the database gets written into a simple text file.  Basically a log.  But this log contains EDI data that needs to be transfered into an FTP folder that is being fetched contantly by the EDI translating system.

So far the application works fine by writting the file in-house, checking whether the file exists or not in order to either append a new line or write a new file altogether and then using cfftp to copy it into the ftp folder.  But, I would then have to manually copy the file and delete the file in-house in order for a new file to be written, otherwise, it'll continue to append new lines on the same file forever.

I'm thinking of 2 possible scenarios.

Using cfschedule to copy the file to the ftp and at the same time delete it locally, or being able to write the log lines automatically into the FTP the same way it does in-house.

Anyone have any ideas how to accomplish this?

Thanks

TOPICS
Advanced techniques

Views

309

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 06, 2011 Jun 06, 2011

Copy link to clipboard

Copied

My preference would be to do everything at once, as opposed to using a scheduled job.

If the intent is to always replace the existing file, that's easy enough with cffile.  However, somehow you have to know whether the previous file has been picked up by your EDI system.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 13, 2011 Jun 13, 2011

Copy link to clipboard

Copied

LATEST

That's the thing. I already have it all working at the same time with cffile 'amend' and 'write', but the client wants me to drop the file every 15 or 20 minutes in his ftp folder.

Locally, checking the existence of the file and either amending writing it is a piece of cake but he wants the file not in my local server's folder but his via ftp.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation