Jump to content

how to upload video and display it like youtube?


j007ha

Recommended Posts

is it anyone can tell me how to upload a video by using php?

 

i noe the different of a video file and other file(like .txt,.jpg,...) is about the file size and file type...

is this the main problem which cause cannot upload the video by using same method?

 

any help will be very appreciated  ;)

how come i still cannot upload video?

 

here is my script:

<?php

if(isset($_POST['upload'])){

	if($_FILES['file_name']['size']<=0){
		echo "File empty";
	}else{
		$name = $_FILES['file_name']['name'];
		$tmp = $_FILES['file_name']['tmp_name'];
		$size = $_FILES['file_name']['size'];
		$type = $_FILES['file_name']['type'];

		if(move_uploaded_file($_FILES['file_name']['tmp_name'],"video/".$_FILES['file_name']['name'])){
			echo "Upload Successfull";
		}else{
			echo "Unable to upload the follwing file".$_FILES['file_name']['name'];
		}

	}

}

?>

<html>

<head>
<title>Uploading Video</title>
</head>

<body>

<form action="form.php" method="post" enctype="multipart/form-data">

	<table border="0" align="center">
		<tr>
			<th>This is the upload video system</th>
		</tr>


	</table>

	<table border="0" align="center">

		<tr>
			<td>Select file :</td>
			<td><input type="file" name="file_name"/></td>
		</tr>

		<tr>
			<td colspan="2" align="center"><input type="submit" value="Upload" name="upload"/></td>
		</tr>
	</table>


</form>
</body>

</html>

yup,i have a video folder...

i have try to upload other file which is .txt and some .wmv file which is (7++kb only) n all of this can be done by easily...

 

but i cannot upload a video .wmv which is much more big size

 

i using print_r to debug already...it show me nothing....

 

???

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.