naveenbj Posted February 5, 2008 Share Posted February 5, 2008 Hello, This is the code which i used for file uploading but from this code im only able to upload small files but for the large files(around 1.5Mb to 6 MB) ,im not able to upload . here is the ?> <? if(($action=="ad_c") { $header_id=trim($_POST['file_header']); $file_name=trim($_FILES[file_name][name]); $current_time = time(); $file_name=$current_time."#".$file_name; $destination_path=$CFG->dirroot.$CONNECTOR."files".$CONNECTOR.$file_name; move_uploaded_file($_FILES[file_name][tmp_name],$destination_path); $query="insert into file(header_id,file_name_server) values($header_id,'$file_name')"; $result=$db->query($query); dbError($result); $error_flag=1; $error_message="File Added !!"; $action="vi"; } ?> --------------- so if anyone can modify this code for me is highly appriciated.. if you have any question for this thn plz ask me .. Regards Nj Quote Link to comment https://forums.phpfreaks.com/topic/89521-php-file-upload-size-limit-problem/ Share on other sites More sharing options...
GingerRobot Posted February 5, 2008 Share Posted February 5, 2008 There are an awful lot of thing syou need to check and change. You should have a hidden field with a max file size set, which may need to be changed. You may also need to change various PHP settings in your php.ini file - including the max_file_size and max_execution_time. Quote Link to comment https://forums.phpfreaks.com/topic/89521-php-file-upload-size-limit-problem/#findComment-458534 Share on other sites More sharing options...
naveenbj Posted February 5, 2008 Author Share Posted February 5, 2008 Anyone is here to help me plz i stuck in this problem and this is vry much taking my likfe:) Nj Quote Link to comment https://forums.phpfreaks.com/topic/89521-php-file-upload-size-limit-problem/#findComment-458583 Share on other sites More sharing options...
ratcateme Posted February 5, 2008 Share Posted February 5, 2008 like GingerRobot said have you checked your php.ini the default max file size is 2MB and max execution time is 30 seconds if you upload takes longer than 30 seconds it wont work or if the file is bigger than 2 MB check max_file_size and max_execution_time in your php.ini Scott. Quote Link to comment https://forums.phpfreaks.com/topic/89521-php-file-upload-size-limit-problem/#findComment-458588 Share on other sites More sharing options...
pdkv2 Posted February 5, 2008 Share Posted February 5, 2008 Use the following lines in top of your script ini_set('max_execution_time', 0); ini_set('max_upload_filesize',60000); Cheers ! Quote Link to comment https://forums.phpfreaks.com/topic/89521-php-file-upload-size-limit-problem/#findComment-458603 Share on other sites More sharing options...
naveenbj Posted February 5, 2008 Author Share Posted February 5, 2008 thank you all !! your suggestions are helpful Regards Nj Quote Link to comment https://forums.phpfreaks.com/topic/89521-php-file-upload-size-limit-problem/#findComment-458606 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.