This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8'> | |
</head> | |
<body> | |
<form action="test.php" method="post" enctype="multipart/form-data"> | |
<dl> | |
<dt>動画・写真</dt> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = $_FILES['my_img']; | |
$ext = substr($file['name'], -4); //ファイル名の後ろ4文字を取得。つまり拡張子を取り出す | |
if($ext == '.gif' || $ext == '.jpg' || $ext == '.png' ) { | |
$filePath = 'tmp/' . $file['name']; //ファイルの移動先。 | |
move_uploaded_file($file['tmp_name'], $filePath);//アップロード | |
print('<img src="'.$filePath.'" />');//アップロードした写真を表示する | |
}else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', 1); | |
$file = $_FILES['gif']; | |
$ext = substr($file['name'], -4); | |
$tempfile = $file['tmp_name'];//一時ファイルの名前を取得 | |
//HTTP POST でアップロードされたファイルかどうか調べる | |
if(is_uploaded_file($tempfile)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = $_FILES['gif']; | |
//var_dump($file); | |
$ext = substr($file['name'], -4); //ファイル名の後ろ4文字を取得。つまり拡張子を取り出す | |
if($ext == '.MOV' || $ext == '.mov' || $ext == '.mp4') { | |
$filePath = 'tmp/' . $file['name']; //ファイルの移動先。 | |
move_uploaded_file($file['tmp_name'], $filePath);//アップロード | |
$gifname = makeName(); | |
exec('ffmpeg -i ' .$filePath. ' tmp/' .$gifname); | |
print('<img src="tmp/'.$gifname.'">');//アップロードした写真を表示する |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<form action="gifmaker.php" method="post" enctype="multipart/form-data"> | |
<dl> | |
<dt>動画・写真</dt> | |
<dd> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = $_FILES['gif']; | |
//var_dump($file); | |
$ext = substr($file['name'], -4); //ファイル名の後ろ4文字を取得。つまり拡張子を取り出す | |
if(is_uploaded_file($file['tmp_name'])){ | |
if($ext == '.MOV' || $ext == '.mov' || $ext == '.mp4') { | |
$filePath = 'tmp/' . $file['name']; //ファイルの移動先。 | |
move_uploaded_file($file['tmp_name'], $filePath);//アップロード | |
$gifname = makeName(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scal=1"> | |
<link href="css/style.css" rel="stylesheet"> | |
</head> | |
<body> | |
<div id="wrap"> | |
<h1>動画からgif画像に変換ツール</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background-color:dimgrey; | |
} | |
#wrap { | |
width:500px; | |
margin-left:auto; | |
margin-right:auto; | |
background-color:oldlace | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = $_FILES['mkv']; | |
//var_dump($file); | |
$ext = substr($file['name'], -4); //ファイル名の後ろ4文字を取得。つまり拡張子を取り出す | |
if(is_uploaded_file($file['tmp_name'])){ | |
if($ext == '.mkv' || $ext == '.MKV') { | |
$filePath = 'tmp/' . $file['name']; //ファイルの移動先。 | |
move_uploaded_file($file['tmp_name'], $filePath);//アップロード |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = $_FILES['gif']; | |
$frameRate = $_POST['frameRate']; | |
//var_dump($file); | |
$ext = substr($file['name'], -4); //ファイル名の後ろ4文字を取得。つまり拡張子を取り出す | |
if(is_uploaded_file($file['tmp_name'])){ | |
if($ext == '.MOV' || $ext == '.mov' || $ext == '.mp4') { | |
$filePath = 'tmp/' . $file['name']; //ファイルの移動先。 | |
move_uploaded_file($file['tmp_name'], $filePath);//アップロード |