-4

重複の可能性:
ファイルのメタデータの読み取り

私はmp3ファイルをアップロードしているこのフォームを持っていますが、ユーザーに音楽をアップロードしてもらい、mp3の作者、タイトルなどのすべての詳細をフォームフィールドに自動的に入力する必要があります。ローカルマシンからファイルの名前を入力し、その名前をフォームのタイトルフィールドに入力します。私のフォームは以下のとおりです。ユーザーにタイトル、著者などを入力させたくない

<form enctype="multipart/form-data" method="post" action="http://youshare.ca/music/writestorypost"><p><span class="form_label">Name of the song</span><input type="text" value="" name="title" style="width:400px" class="inputText required"></p><p><span class="form_label">Description</span>
<textarea class="rich" style="width:580px" rows="18" name="form_content"></textarea>
</p><p><span class="form_label">Tags</span>
    <input type="text" value="" style="width:300px" name="tags" class="inputText">
    <span>Multiple tags should be Separated with commas(,)</span>
    </p>
        <p><label>Upload</label><input type="file" name="song">
        <span>Only mp3 is accepted</span></p>
        <p><label>Music source</label>
        <input type="radio" checked="1" value="own" name="musicsource">My own 
        <input type="radio" value="others" name="musicsource">From another musician
        </p>
        <div style="display:none" id="ms_others">
        <p><label>Musician name</label><input name="musician"></p>
        </div>
        <div id="ms_own">
        <p></p>
        </div>
        <p><label>Picture (Optional)</label><input type="file" name="picture">
        <span>A picture about the song or the musician</span></p>
        <script type="text/javascript">
    jQuery(document).ready(function($) {
        $("input[value='own']").click(
            function() {
            $("#ms_others").hide();
            $("#ms_own").fadeIn();
            }
            );
      $("input[value='others']").click(
            function() {
            $("#ms_own").hide();
            $("#ms_others").fadeIn();
            }
            );
    })
  </script><p><input type="submit" value="Submit" class="button"></p><input type="hidden" value="935" name="page_id"></form>
4

1 に答える 1

0

すべての情報を手動で入力しない限り、ファイルのアップロード後に MP3 の詳細を入力する必要があります。

PHP 側では、次のものをインストールできます。PHP ID3

ファイルから ID3 タグを読み取る方法の例があります。

于 2012-08-02T18:13:56.983 に答える