[PHP] HTTP_Upload with PHP
We have an application that used PHP's FTP function to upload files. Now it worked until we upgraded to 4.1.2. We have now downgraded back to 4.1.1 but still no luck, it won't work. We have set upload_max_filesize and post_max_size as well, and that doesn't seem to help. Here is the following code. It has not changed since it went live: srand((double)microtime()*100); //Create random timestamp for the file temp file $randval = rand(); //Creates a temp file that the file gets put in, we then read that file $tmpfile = /tmp/ . $file_name . $randval; copy($file,$tmpfile);//line 272 ftp_put($this-connection,$file_name,$tmpfile,FTP_BINARY); //line 273 unlink($tmpfile); return true; This is inside a function, and $file is the handle for the uploaded file and $file_name is the name of the uploaded file. The weird thing is that this will work for small files ( 1MB). Anything bigger, it gives us the following errors: Warning: Unable to open 'none' for reading: No such file or directory in /Ftp.inc on line 272 Warning: error opening /tmp/IP4_0EngALLMsi.exe1419195771 in /Ftp.inc on line 273 Any ideas? It seems as if the big files are not getting passed in? Thanks, /rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTTP_Upload with PHP
'none' comes from a failed file upload. Figure out why the file upload is not working. Did you perhaps turn file uploads off in your php.ini file? -Rasmus On Wed, 20 Mar 2002, Rick wrote: We have an application that used PHP's FTP function to upload files. Now it worked until we upgraded to 4.1.2. We have now downgraded back to 4.1.1 but still no luck, it won't work. We have set upload_max_filesize and post_max_size as well, and that doesn't seem to help. Here is the following code. It has not changed since it went live: srand((double)microtime()*100); //Create random timestamp for the file temp file $randval = rand(); //Creates a temp file that the file gets put in, we then read that file $tmpfile = /tmp/ . $file_name . $randval; copy($file,$tmpfile);//line 272 ftp_put($this-connection,$file_name,$tmpfile,FTP_BINARY); //line 273 unlink($tmpfile); return true; This is inside a function, and $file is the handle for the uploaded file and $file_name is the name of the uploaded file. The weird thing is that this will work for small files ( 1MB). Anything bigger, it gives us the following errors: Warning: Unable to open 'none' for reading: No such file or directory in /Ftp.inc on line 272 Warning: error opening /tmp/IP4_0EngALLMsi.exe1419195771 in /Ftp.inc on line 273 Any ideas? It seems as if the big files are not getting passed in? Thanks, /rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTTP_Upload with PHP
Hello, I also have been seeing file upload problems with version 4.1.2. It seems that the (phpinfo()) default settings of: upload_tmp_dir = no value no value ... are not in agreement with [online documentation] the anticipated temporary upload folder named /tmp. $upload_tmp_dir = /tmp as the default included in the distribution file may improve harmony. Richard. [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php