Jump to content

upload videos and music files using php


honee

Recommended Posts

hi!

i want to upload videos and music files using php but it's not working correctly.through this code imges are uploaded successfully but there is problem with video files ..i hv use php.ini to resolve the size prblem but still its not working..can u give me any code that works perfectly.

here is my code..

Collapse

<?php

ini_set('post_max_size', 5242880);    // Set upload limit (5MB)

ini_set('upload_max_filesize', 5242880);    // Enforce upload limit

ini_set('max_execution_time', 2400);    // Increase 'timeout' time

 

echo "<form enctype='multipart/form-data' name='form2' method='post' action='video.php?view_id=view'>";

if(isset($_REQUEST['Submit']))

{

print_r($_FILES['file2']);

$music=($_FILES['file2']['name']);

if($_FILES['file2']['error']>0)

{

    echo "error accured";

}

else

{

    move_uploaded_file($_FILES['file2']['tmp_name'],"uploadedMusic/".$_FILES['file2']['name']);

}

 

}

 

echo "<input name='file2' type= 'file'>";

echo "<input name='Submit' type='submit' value='upload music'>";

echo "</form>";

?>

Link to comment
https://forums.phpfreaks.com/topic/238194-upload-videos-and-music-files-using-php/
Share on other sites

Try this in the php.ini file

 

Raise limits until see working.

 

memory_limit = 128M
post_max_size = 15M
upload_max_filesize = 10M 

 

I don't believe upload time counts towards execution time when using move_uploaded_file.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.