Re: [PHP] file upload error
Thanks for the replies. My manual was out of date, not that it would have made any difference to this anyway as . upload_tmp_dir variable was correctly set in the php.ini file, and I'd restarted the web server several times. It seems however that the file is getting cached somehow, and is not re-read until I restart the entire box. Anyone out there know why this may be, or a slightly better way of getting around it than rebooting? (By the way, the upload functionality is fine after the reboot :)) Ta Tom Marek Kilimajer wrote: Tom wrote: Hi I have a very simple file upload form and script to handle it (copied verbatim from the php manual, except for the file target location and the script name). However, it always fails, with an error code in the _FILE array or 6. Does anyone know what this error is or what I am likely to have set wrong? All that I can find in the docs are errors from 0 to 4 :-( It's there: http://sk.php.net/manual/en/features.file-upload.errors.php UPLOAD_ERR_NO_TMP_DIR Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and PHP 5.0.3. Note: These became PHP constants in PHP 4.3.0. Set the correct upload_tmp_dir in php.ini and restart webserver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file upload error
Tom wrote: Thanks for the replies. My manual was out of date, not that it would have made any difference to this anyway as . upload_tmp_dir variable was correctly set in the php.ini file, and I'd restarted the web server several times. It seems however that the file is getting cached somehow, and is not re-read until I restart the entire box. Anyone out there know why this may be, or a slightly better way of getting around it than rebooting? (By the way, the upload functionality is fine after the reboot :)) Several possibilities here... First, you can ERADICATE the idea that the file was getting cached, at least by Apache or PHP. Maybe you've got something really funky in your file-system to cache it, but that's also incredibly unlikely. On to the possible scenarios: 1. You only *THOUGHT* you re-started Apache, but the script you use to stop/start Apache, or Apache itself, failed to inform you that it didn't stop and then start correctly. 2. You *DID* re-start Apache, but the script you used is telling Apache to read a DIFFERENT httpd.conf from the one that gets read by your boot processing script (/etc/rc.init/[apache|httpd] probably, on Linux). That different httpd.conf, in turn, points to a DIFFERENT php.ini and/or mod_php.so getting loaded, so the php.ini you *thought* was getting re-loaded when you restarted Apache, was not the one really getting loaded. You can easily confirm/deny #2 by looking at ?php phpinfo();? after a re-boot, then re-starting Apache, then looking at ?php phpinfo();? again. The same php.ini file should be listed near the top in both cases, or you'll quickly find out which php.ini file[s] are being read. For #1, you can try your Apache re-start again, and use http://localhost/server-status (or is that server_status) to see Apache's up-time, if you have mod_status installed. Or you could use ps auxwww | grep httpd to see how long Apache has been runing. Or maybe use top to find out if you really really re-started Apache. Hopefully, this is a development machine so you can re-start and re-boot as needed to track down what is or isn't happening. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file upload error
Hi I have a very simple file upload form and script to handle it (copied verbatim from the php manual, except for the file target location and the script name). However, it always fails, with an error code in the _FILE array or 6. Does anyone know what this error is or what I am likely to have set wrong? All that I can find in the docs are errors from 0 to 4 :-( Also, the tmp_name is always empty (as is the type, but I would expect that as I'm not explicitly setting it). My config is php5 with apache 2 on linux. My php.ini file has upload_tmp_dir explicitly set to /tmp (permissions on this are 777) Code as follows :- 1) Form 1 html 2headtitleForm to test file uploads/title/head 3 4 body 5 6 form enctype=multipart/form-data action=uploadHandler.php method=POST 7 !-- MAX_FILE_SIZE must precede the file input field -- 8 input type=hidden name=MAX_FILE_SIZE value=3 / 9 !-- Name of input element determines name in $_FILES array -- 10 Send this input name=userfile type=file / 11 input type=submit value=Send File / 12 /form 13 14 /body 2) Handler 1 ?php 2 // script to handle file uploads. Files are recieved from uploadForm.php in same directory. 3 4 $uploaddir = '/usr/local/apache2/htdocs/TradEx/uploads/'; 5 $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); 6 7 echo 'pre'; 8 if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) 9 { 10 echo File is valid, and was successfully uploaded.\n; 11 } 12 else 13 { 14 echo Possible file upload attack!\n; 15 echo 'Here is some more debugging info:'; 16 print_r($_FILES); 17 print /pre; 18 } 19 20 ? 3) Output :- Possible file upload attack! Here is some more debugging info:Array ( [userfile] = Array ( [name] = MANIFEST [type] = [tmp_name] = [error] = 6 [size] = 0 ) ) Thanks for any help Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file upload error
Tom wrote: Hi I have a very simple file upload form and script to handle it (copied verbatim from the php manual, except for the file target location and the script name). However, it always fails, with an error code in the _FILE array or 6. Does anyone know what this error is or what I am likely to have set wrong? All that I can find in the docs are errors from 0 to 4 :-( It's there: http://sk.php.net/manual/en/features.file-upload.errors.php UPLOAD_ERR_NO_TMP_DIR Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and PHP 5.0.3. Note: These became PHP constants in PHP 4.3.0. Set the correct upload_tmp_dir in php.ini and restart webserver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file upload error w/internet exploder!
I've created a simple form that uploads file to my server. I noticed that I'm having problems when I use Internet Explorer 4.5 and 5.0 on the Mac (I haven't checked it yet on the pc). It may have something to do with the path to the file. When I use Netscape, the entire path is displayed in the form field prior to upload. IE only displays the file name, no path. Is there a way that I could force the path along, echo maybe? You aren't necessarily supposed to see the full path or not, nor does your script need it. You should only get the filename by the time it reaches PHP. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] File upload error
I have a script that works fine on my server but gives this error on the server where I need it. Warning: File Upload Error - Unable to open temporary file [./php06339aaa] in /home/sites/site9/web/photo_admin/upload.php3 on line 138 Could someone point me in the right direction? Thanks. Data Driven Design PO Box 1084 Holly Hill, Florida 32117 http://www.datadrivendesign.com http://www.rossidesigns.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] File upload error
that sounds like a permissions error. check the permissions for all of the directories and the file along your path. -Original Message- From: Data Driven Design [mailto:[EMAIL PROTECTED]] Sent: Friday, January 26, 2001 1:04 PM To: [EMAIL PROTECTED] Subject: [PHP] File upload error I have a script that works fine on my server but gives this error on the server where I need it. Warning: File Upload Error - Unable to open temporary file [./php06339aaa] in /home/sites/site9/web/photo_admin/upload.php3 on line 138 Could someone point me in the right direction? Thanks. Data Driven Design PO Box 1084 Holly Hill, Florida 32117 http://www.datadrivendesign.com http://www.rossidesigns.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]