Jump to content

_FtpPutFile Fails after 20 uploads


 Share

Recommended Posts

This problem has me baffled.

My script uploads GIF files to a directory on my server.

There are currently 23 GIF files so I have 23 lines:

After it successfully uploads the first 20 files, it fails to upload the 21st file, then after a brief pause, continues to successfully upload the final 2 files.

It does not matter how I rearrange these lines. It isn't the file itself causing the problem, it has something to do with there being more than 20 files as it ALWAYS fails on the 21st file and I end up with a file with 0 bytes on my server for the 21st file.

Any ideas what would cause this?

**I've included SplashTextOn() before each _FtpPutFile line so I would be able to see where it was failing each time.

SplashTextOn("FTP Transfer", "AUDUSD.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\AUDUSD.gif', '/public_html/wp-content/uploads/CEcharts/AUDUSD.gif') 
SplashTextOn("FTP Transfer", "GBPUSD.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\GBPUSD.gif', '/public_html/wp-content/uploads/CEcharts/GBPUSD.gif')
SplashTextOn("FTP Transfer", "USDCAD.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\USDCAD.gif', '/public_html/wp-content/uploads/CEcharts/USDCAD.gif')
SplashTextOn("FTP Transfer", "EURUSD.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\EURUSD.gif', '/public_html/wp-content/uploads/CEcharts/EURUSD.gif')
SplashTextOn("FTP Transfer", "USDJPY.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\USDJPY.gif', '/public_html/wp-content/uploads/CEcharts/USDJPY.gif')

SplashTextOn("FTP Transfer", "SP.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\SP.gif', '/public_html/wp-content/uploads/CEcharts/SP.gif')
SplashTextOn("FTP Transfer", "US.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\US.gif', '/public_html/wp-content/uploads/CEcharts/US.gif')
SplashTextOn("FTP Transfer", "W.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\W.gif', '/public_html/wp-content/uploads/CEcharts/W.gif')
SplashTextOn("FTP Transfer", "AD.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\AD.gif', '/public_html/wp-content/uploads/CEcharts/AD.gif')
SplashTextOn("FTP Transfer", "BP.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\BP.gif', '/public_html/wp-content/uploads/CEcharts/BP.gif')
SplashTextOn("FTP Transfer", "C.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\C.gif', '/public_html/wp-content/uploads/CEcharts/C.gif')
SplashTextOn("FTP Transfer", "CD.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\CD.gif', '/public_html/wp-content/uploads/CEcharts/CD.gif')
SplashTextOn("FTP Transfer", "CL.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\CL.gif', '/public_html/wp-content/uploads/CEcharts/CL.gif')
SplashTextOn("FTP Transfer", "CT.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\CT.gif', '/public_html/wp-content/uploads/CEcharts/CT.gif')
SplashTextOn("FTP Transfer", "FN.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\FN.gif', '/public_html/wp-content/uploads/CEcharts/FN.gif')
SplashTextOn("FTP Transfer", "GC.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\GC.gif', '/public_html/wp-content/uploads/CEcharts/GC.gif')
SplashTextOn("FTP Transfer", "JY.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\JY.gif', '/public_html/wp-content/uploads/CEcharts/JY.gif')
SplashTextOn("FTP Transfer", "KC.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\KC.gif', '/public_html/wp-content/uploads/CEcharts/KC.gif')
SplashTextOn("FTP Transfer", "LC.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\LC.gif', '/public_html/wp-content/uploads/CEcharts/LC.gif')
SplashTextOn("FTP Transfer", "LH.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\LH.gif', '/public_html/wp-content/uploads/CEcharts/LH.gif')
SplashTextOn("FTP Transfer", "S.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\S.gif', '/public_html/wp-content/uploads/CEcharts/S.gif')  FAILS HERE!!!
SplashTextOn("FTP Transfer", "SB.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\SB.gif', '/public_html/wp-content/uploads/CEcharts/SB.gif')
SplashTextOn("FTP Transfer", "SI.gif")
$Ftpp = _FtpPutFile($Conn, 'C:\Users\Rick\Documents\GRAPHS\Cycle Envelopes\SI.gif', '/public_html/wp-content/uploads/CEcharts/SI.gif')

 

In the example above, I end up with the file S.gif being only 0 bytes in size as it does not upload correctly.  All the other files will upload correctly.

But if I switch these lines around, for example, and say I make the FN.gif the 21st file, then it will be the file with 0 bytes having failed to upload correctly.

Something is happening after 20 successful uploads and I just can't figure it out.

Help?

TIA

 

 

Link to comment
Share on other sites

Here's a crazy idea, why don't you check to see if there was an error after each _FtpPutFile() and if so, call _FTP_GetLastResponseInfo to see if maybe it will give you an idea why it failed.  Better yet, why don't you put your _FtpPutFile into a function that has error checking logic?  That way you don't have to add the error checking 20+ times, you just have to do it once.

YWIA

Edited by TheXman
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...