sassenach Posted October 6, 2009 Share Posted October 6, 2009 Hi, I am using a script to upload media files. Here it is: $filename_audio = 'uploadintaudio'; $tmpName_audio = $_FILES[$filename_audio]['tmp_name']; if(empty($_POST['intclip_which'])) {$_POST['intclip_which'] = 0;} if($_POST['intclip_which'] == 1){ //change image only echo 'MEDIA --> <br/> name '.strtolower($_FILES[$filename_audio]['name']).'<br/> isset? '.isset($_FILES[$filename_audio]).'<br/> which '.$_POST['intclip_which'].'<br/> error '.$_FILES[$filename_audio]['error'].'<br/> type '.ereg($media_types,strtolower($_FILES[$filename_audio]['type'])).'---- '.$_FILES[$filename_audio]['type']; if (isset($_FILES[$filename_audio]) && ($_FILES[$filename_audio]['error'] != 4) && ereg($media_types,strtolower($_FILES[$filename_audio]['type']))) { $intaudio = array_change_key_case($_FILES[$filename_audio],CASE_LOWER); } else { $intaudio = FALSE; $ErrorMsg .= 'Either the file format is incorrect or you have not choosen a media file.<br />'; } } else {$intaudio = TRUE;} $intaudio_name = strtolower($intaudio['name']); $intaudio_type = strtolower($intaudio['type']); $intaudio_size = strtolower($intaudio['size']); Note: $media_types = "(rmi|wav|wma|wmv|wm|wmvhd|wax|mpg|mid|midi|mpeg|m1v|mp2|mp3|mpa|mpe)\$";/*avi|asf|asx|*/ You can see i print (echo) the file name, error, type, etc. This is my result: MEDIA --> name butterfly.wmv isset? 1 which 1 error 1 type ---- As you can see the file type is missing. And the error =1 which means the max-uploadsize is not enough. The file size im trying to upload is 2.5M and my max post and max upload size is set to 50M. I am not sure where the problem is. Any help is welcomed. thanks Quote Link to comment https://forums.phpfreaks.com/topic/176728-uploading-media-files-trouble/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 6, 2009 Share Posted October 6, 2009 max post and max upload size is set to 50M.Yes, but what are the actual settings that a phpinfo() statement shows and where exactly did you change the settings at? If there is a syntax error in the setting or the method that you used to set it is not the one that php is using, the setting is not actually change to what you think it is. Quote Link to comment https://forums.phpfreaks.com/topic/176728-uploading-media-files-trouble/#findComment-931755 Share on other sites More sharing options...
sassenach Posted October 6, 2009 Author Share Posted October 6, 2009 im not sure what you mean. u want me to show u the phpinfo()? Quote Link to comment https://forums.phpfreaks.com/topic/176728-uploading-media-files-trouble/#findComment-931758 Share on other sites More sharing options...
PFMaBiSmAd Posted October 6, 2009 Share Posted October 6, 2009 Only the relevant part - http://en.wikipedia.org/wiki/Relevance_%28disambiguation%29 Quote Link to comment https://forums.phpfreaks.com/topic/176728-uploading-media-files-trouble/#findComment-931759 Share on other sites More sharing options...
sassenach Posted October 6, 2009 Author Share Posted October 6, 2009 PHP Version 5.2.9 post_max_size 50M upload_max_filesize 50M safe_mode Off register_globals On file_uploads On memory_limit 32M anything else? Quote Link to comment https://forums.phpfreaks.com/topic/176728-uploading-media-files-trouble/#findComment-931761 Share on other sites More sharing options...
PFMaBiSmAd Posted October 6, 2009 Share Posted October 6, 2009 Are those the local values or the master values? Also, where exactly did you change the settings at? You would not be getting that value for the ['error'] element unless the size of the file is larger than the upload_max_filesize setting that php is using. Either the size of the file is not what you think it is or the actual setting that php is using is not what you think it is. Quote Link to comment https://forums.phpfreaks.com/topic/176728-uploading-media-files-trouble/#findComment-931769 Share on other sites More sharing options...
sassenach Posted October 6, 2009 Author Share Posted October 6, 2009 these are local and master. same values. I am getting error value 1. I tried a couple of files over 2M and it gave me this error. When i try a file that is under 2M it seems to work. that is why i have no clue what to do now. Quote Link to comment https://forums.phpfreaks.com/topic/176728-uploading-media-files-trouble/#findComment-931775 Share on other sites More sharing options...
PFMaBiSmAd Posted October 6, 2009 Share Posted October 6, 2009 Was the file with the phpinfo() in the same folder where your upload script is at? You may want to check with your web host because if they have not configured the server to allow you to change the php settings, they might not actually get changed to the values you set, despite what the phpinfo() shows. Quote Link to comment https://forums.phpfreaks.com/topic/176728-uploading-media-files-trouble/#findComment-931783 Share on other sites More sharing options...
sassenach Posted October 6, 2009 Author Share Posted October 6, 2009 there is one php.ini file in the main web root directory and the file is in another folder. in this website cpanel, it has php config area. there the php file is selected as single file. meaning one file for the whole site. so i wont need to duplicate the php.ini file. Quote Link to comment https://forums.phpfreaks.com/topic/176728-uploading-media-files-trouble/#findComment-931836 Share on other sites More sharing options...
sassenach Posted October 6, 2009 Author Share Posted October 6, 2009 this is the options i have in the php config in cpanel: PHP5 All files with the extension .php will be handled by the PHP5 engine. Current, most reliable and best performing version of PHP PHP5 (Single php.ini) Same as PHP5, but all subdirectories will use ~/public_html/php.ini PHP5 (FastCGI) All files with the extension .php will be handled by PHP5 FastCGI processes. FastCGI for PHP makes all your PHP applications run through mod_fastcgi instead of mod_suphp. This eliminates the overhead of loading the PHP interpretor on every hit. Since it is always in memory ready for the next hit, the responses will be generated faster. PHP5 (Single php.ini) is selected. Quote Link to comment https://forums.phpfreaks.com/topic/176728-uploading-media-files-trouble/#findComment-931839 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.