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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.