[PHP] FTP'ing with function
I am trying to ftp with php code. The code works, but the file is truncated for some reason. The only thing that I could think of would be directive in the php.ini file, but these seem to be ok: max_execution_time = 60 > the files / script process quickly, so this doesn't seem to be the problem upload_max_filesize = 32M > the files are not anywhere close to this max size Can anyone think what might be causing my problem. You can see the sample files at: www.financialnewsusa.com/xml/35.xml and www.financialnewsusa.com/xml/35_truncated.xml -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] testing for empty array
I have an array $keywords, how do I test to see if it is empty? $keywords == '' seems to throw out an error. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] socket_set_blocking()
I was not able to get php's ftp functions working for me, they were uploading zero byte files, so I am now attempting to use fsockopen to accomplish the task. I found this script: http://www.phpbuilder.com/mail/php-general/2001102/1333.php It uses the function: socket_set_blocking(), and php.net says that this is an alias for stream_set_blocking(). What does blocking mode mean? I am not familiar with this concept, can someone explain. As for the issue of socket_set_blocking() being an alias for stream_set_blocking(), why would I not just use stream_set_blocking? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sorry if repost - more ftp problems
I tried to ftp with php's ftp functions, but was only able to upload zero byte files. So, I then tried to upload with fsockopen, but again, my script uploads a zero byte file. It bombs out at: FTP transaction: 220 marlborough FTP server (CH/1.9) ready. 331 Password required for [EMAIL PROTECTED] 230 User admin logged in. 250 CWD command successful. 200 Type set to I. 227 Entering Passive Mode (207,155,248,73,195,80) Fatal error: Maximum execution time of 90 seconds exceeded in c:\apache\htdocs\fnusa\releases\ftp.php on line 28 My script can be seen at http://www.financialnewsusa.com/xml/ftp.php Any suggestions would be greatly appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] File Handles?
The following is a script from the php.net site for supposedly uploading files via ftp. My question is, why do we have to build handles, what is the purpose of creating this array? //Build handles for uploaded image $imageUpFile = $_FILES['photo_file']['tmp_name']; $imageType = $_FILES['photo_file']['type']; $imageName = $_FILES['photo_file']['name']; //Open the uploaded pic (temp file) if ($thePic = fopen ($imageUpFile, "rb")) { //read temp file into var $savePic = fread($thePic, filesize($imageUpFile)); //Open a new file in the correct directory using the name of the uploaded pic file if ($fileHandle = fopen("ftp://username:password@put/directory/here/$imageName";, "w")) { //Put data into just opened file pointer if (fwrite ($fileHandle, $savePic)) { echo "file $imageName successfully written"; } else { echo "file $imageName was NOT written"; } } fclose ($fileHandle); fclose ($thePic); } else { // The file was not created. Inform the user. echo (" The file: $imageUpFile could not be created! "); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php