php - Need Help Regarding Uploading Video Files -
i working on simple upload script. thing when upload image file uploaded on server , data written in database when try upload video files mp4, , audio mp3 file, server gives me error.
http://i.stack.imgur.com/fcq2c.png
here upload.php code.
<?php include('config.php'); function bytestosize1024($bytes, $precision = 2) { $unit = array('b','kb','mb'); return @round($bytes / pow(1024, ($i = floor(log($bytes, 1024)))), $precision).' '.$unit[$i]; } $filename = $_files['filename']['name']; $filetype = $_files['filename']['type']; $filesize = bytestosize1024($_files['filename']['size'], 1); $fileid = uniqid(rand()); $query2 = "insert files (id, name, size, type) values ('$fileid', '$filename', '$filesize '$filetype')"; $result2 = mysql_query($query2); echo <<<eof <p>your file: {$filename} has been received.</p> <p>type: {$filetype}</p> <p>size: {$filesize}</p> eof;
here index.html code
<form action="upload.php" method="post" enctype="multipart/form-data"> <center><p> <input type='file' size='58' style='height: 30px; font-size: 18px' name='filename'></p> <input type="submit" name="submit" value="upload"> </form>
are video files more max upload filesize of 2 mb (default). php change maximum upload file size
Comments
Post a Comment