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

Copy File from 1 Server to Another

Participant ,
Jan 10, 2019 Jan 10, 2019

Copy link to clipboard

Copied

I have an application that is on 2 servers where form data from server #1 populates and creates a fill-in PDF on server #2

Server #1  - Railo server  (Cant do PDF stuff)

Enter Info into Form  > Submit Form to Server #2

Server #2 -Windows server with CF16 on it

Gets form field info and creates a PDF.

Now I want that PDF to be copied back to server #1.

How can I do that?

Do I save it on server #2 and then do some file transfer or can I save it back to server #1?

Views

626

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

correct answers 1 Correct answer

LEGEND , Jan 11, 2019 Jan 11, 2019

I agree with Dave Watts​ on this one.  You could also use AJaX in a semi-sneaky way.

Ex:  Replace the form submit button with a plain old regular button and use JavaScript to create an XHR (or use jQuery to $.post() the data) and submit to both servers (assuming server 1 retains the data in a database, or creates an email and sends it.)  Server 1 will retain/email the data, server 2 will use a CFC to create the PDF and return it to the user for downloading.

OR, server 2 could create the PDF, retu

...

Votes

Translate

Translate
Community Expert ,
Jan 10, 2019 Jan 10, 2019

Copy link to clipboard

Copied

You're not going to be able to just save it back to server one the way you're describing it. But there's no reason why you couldn't capture the data on server one, have server one send that data to server two via CFHTTP and get back the PDF, then save it temporarily on server one and serve it back to the original user. Note that PDF generation is slooooow, so you'll have to build a process that takes this into account.

Dave Watts, Eidolon LLC

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
LEGEND ,
Jan 11, 2019 Jan 11, 2019

Copy link to clipboard

Copied

I agree with Dave Watts​ on this one.  You could also use AJaX in a semi-sneaky way.

Ex:  Replace the form submit button with a plain old regular button and use JavaScript to create an XHR (or use jQuery to $.post() the data) and submit to both servers (assuming server 1 retains the data in a database, or creates an email and sends it.)  Server 1 will retain/email the data, server 2 will use a CFC to create the PDF and return it to the user for downloading.

OR, server 2 could create the PDF, return a message to the client that an email is on its way, and email the PDF to the user.

V/r,

^ _ ^

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
Participant ,
Jan 11, 2019 Jan 11, 2019

Copy link to clipboard

Copied

I created the email on server#2 and sent an email with the attachment to the user. Thank you

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
LEGEND ,
Jan 14, 2019 Jan 14, 2019

Copy link to clipboard

Copied

LATEST

Thank you for marking my answer as correct.  I do appreciate it, and I'm sure a future user with the same issue will, too.

V/r,

^ _ ^

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