Not able to upload big video files using php

Hi friends,
i want to upload big vedio file , i set my php.ini file with below values

post_max_size = 200M
max_execution_time = 300
upload_max_filesize = 300
max_input_time = 300

but not able to upload more than 2M file ,when i try to upload more than 2m file i got blank value of $_FILE['requiredVideo']['tmp_name'] , while i try to do with less than 2M its work great.

anyone has idea how can i solve this problem , i'm very fustrate about this.

PLEASE HELP ME if anyone has solution of this.

Thanks in advance

Regards,

Darshan


$Video = "" ;
		$upload_class = new Upload_Files;
		$upload_class->temp_file_name = $_FILES['requiredVideo']['tmp_name'];
 
#------------------------
// I DIDN'T GET VALUE OF $_FILES['requiredVideo']['tmp_name']; variable for big file
#------------------------
 
 
		$upload_class->file_name = "v_".$Code .$_FILES['requiredVideo']['name'];
		$upload_class->upload_dir = "../videos/";
		$upload_file = $upload_class->upload_file_no_validation();
		
		if ($upload_class->get_file_size()<= 0)
		{
			$Video= "";
			exit("Error : Too big file.") ;
 
		} else
		{
			$Video= "v_".$Code .trim(strtolower($_FILES['requiredVideo']['name']));
			$extension = $upload_class->get_extension() ;
		}

Open in new window

dvpandyaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dvpandyaAuthor Commented:
hi

plz do not confuse with

upload_max_filesize = 300
its typing mistake

i mean to say
upload_max_filesize = 200M

thanks

regards

darshan
0
hernst42Commented:
What value is stored in $_FILES['requiredVideo']['error'] ?
Are you sure you have restarted the webserver after changing the php.ini settings?
0
paulp75Commented:
perhaps try higher values

max_input_time 6000
max_execution_time 6000
post_max_size 300M
upload_max_filesize = 300M
memory_limit = 32M

or add something like this to .htaccess file
php_value max_input_time 600
php_value max_execution_time 600
php_value post_max_size 200M


good luck
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

dvpandyaAuthor Commented:
Thank you guys for reply

I don't have access to restart the server, they provide me only php.ini access

i also try to set it using php fn.       

ini_set('post_max_size','200M') ;
ini_set("session.gc_maxlifetime","10800");

and $_FILES['requiredVideo']['error'] show me 1

i don't know what is the meaning of it

Please help

Thanks

Regards

Darshan

i can see the updated values in phpinfo()
0
dvpandyaAuthor Commented:
thank you for your guidance i got that php.ini is not updated , i told the client to restart server. lets cross the finger that everything will work

Thank you again hernst42

Regards,

Darshan
0
paulp75Commented:
if it doesnt work then try to do it with htaccess, hopefully you'll get it sorted though. good luck
0
dvpandyaAuthor Commented:
Thank you paulp75

i'm not familiar with .htaccess programing

i just paste your lines

php_value max_input_time 600
php_value max_execution_time 600
php_value post_max_size 200M

in .htaccess file but i got internal server error.i don't know what i did wrong.Plz help me. i have to solve this problem by code only . php server will not be restarted , they said it'll be handled by scrip only
i don't under stand what i do.
thank you for your response

regards

darshan



 
0
dvpandyaAuthor Commented:
hi

i tried to upload file using ftp_put , but also not work for me

actually it started to create the file at the destination, but it's of zero size
please help me what i do now

i tried both FTP_ASCII and FTP_BINARY, but not get success
regards


		#------------ FTP Uploading ------------------
		$ftp_server = "Site IP";
		$ftp_user_name = "username";
		$ftp_user_pass = "password";
 
		$conn_id = ftp_connect($ftp_server,21) or die("Not Connected"); 
		// login with username and password
		if ($conn_id)
		{
			$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); 
		}	
		else
			exit("Connection Not found")  ;	
 
		if ((!$conn_id) || (!$login_result)) { 
				exit("FTP connection has failed!<BR>"); 
			} 
 
			$destination_file = "/public_html/videos/v_".$Code . $_FILES['requiredVideo']['name'];
			$source_file = $_FILES['requiredVideo']['tmp_name'];
			
			
			ftp_pasv($conn_id, true);
			// upload the file
			$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); 
			
			// check upload status
			if (!$upload) { 
					$Video = "";
					exit("Error : FTP upload has failed!") ;					
				} else {
					$Video = "v_".$Code .$_FILES['requiredVideo']['name'] ;
				}

Open in new window

0
hernst42Commented:
ftp does not help in this case, as the uploaded file is still transfered via HTTP from the client and not via ftp from the client. You only make things more worse with that as you are trying to move the alread defect uploaded file via ftp, what could normally be done via normal file function.
Get your webhoster fix the uploadfile-limit in php
0
dvpandyaAuthor Commented:
Hi guys

Thank you for your help i got the solution , webhoster set that i have to place php.ini file from where i'm uploading the file. so i duplicate php.ini file in my desired folder and its work perfectly.

Thank you again for your help

Regards

Darshan
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.