Skip to main content
Participating Frequently
August 3, 2023
Question

Not able to upload more then 2 GB file via cfftp

  • August 3, 2023
  • 2 replies
  • 1397 views

Hi,

I am using cfftp to transfer file to ftp server. I am able to upload file around 2 gb but I am not able to upload more then 2 gb file via cfftp coldfusion. I am using chrome browser.

The code is under as:

<cfftp connection="session.ftpConn"
action="open"
server="testserver"
username="testuser"
password="testpassword"
stoponerror="Yes"
timeout="90000">
<!---Did it open connection? <cfoutput>#cfftp.succeeded#</cfoutput><br />--->
<cfif cfftp.succeeded>
 
<cfftp connection = "session.ftpConn"
action = "PutFile"
localFile="#form.FileContents#"
remoteFile="#variables.uploadedFileServerName#"
stoponerror="Yes"
passive = "Yes"
timeout="90000">
 
<cfif CFFTP.Succeeded>
<!---<P>Close the connection:--->
<CFFTP ACTION="close"
CONNECTION="session.ftpConn"
STOPONERROR="Yes">
 
what needs to be done for this?
    This topic has been closed for replies.

    2 replies

    Participating Frequently
    August 6, 2023

    Have you tried uploading a file larger that 2GB to the FTP server outside of CF? Try uploading the file from your compuuter to see if it is the FTP server blocking files greater than 2GB.

     

    Charlie Arehart
    Community Expert
    Community Expert
    August 5, 2023

    What's needed is more diagnosis.

    1. Your code shows you test some things, but you are not showing the complete code (since we don't see a closing cfif).
    2. More to the point, what error do you get? Where do you get it? In the browser? in the logs? in what logs? and what error message, specifically?
    3. You mention using chrome, and of course the cfftp is entirely between the CF instance and the ftp server, so the browser running the CF page has nothing to do with the FTP operation.
    4. But this could just be a long-running operation, and you could get a failure in the browser (because it doesn't want to wait as long as is needed). Do you?
    5. And the CF page may be proceeding to completion, despite the browser request failing. Again, you're doing various tests in the code. Do you find it indicating that the operation DOES succeed? Rather than write diagnostics with cfoutput, which go to the browser (which may no longer be there), write them to the CF logs using cflog, which writes to the CF application.log by default. Just <cflog text="some words"> would suffice.
    6. Finally, if you may say "I know it's not failing because the file never shows up on the FTP server", note also that the FTP server itself may be preventing that large upload, or may be timing out.  Look to the FTP server's logs. They may tell you more that could be valuable.

     

    As with so many problems people experience in CF, most of the challenge in solving them is in finding the right diagnostics that indicate where and what the problem is. I get it that people often don't know where to begin to look, so they throw the problem out to the community in case someone may readily recognize some obvious cause.  I share the above in case no one does that.

     

    And rather than await the hope that someone may, could you please go ahead and reply now to those? It could help you, and us, and others. Thanks.

    /Charlie (troubleshooter, carehart. org)