riqrat Posted January 3, 2020 Share Posted January 3, 2020 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 More sharing options...
TheXman Posted January 3, 2020 Share Posted January 3, 2020 (edited) 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 January 3, 2020 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now