Changeset 31
- Timestamp:
- 04/23/07 16:16:15 (2 years ago)
- Files:
-
- trunk/submit_audio.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/submit_audio.php
r23 r31 55 55 else crash(3,"ERROR: cannot parse login result; login probably failed"); 56 56 57 $result = upload($upload_url,$session_id,$tar_gz_path );57 $result = upload($upload_url,$session_id,$tar_gz_path,$session_dir); 58 58 if (!$result) crash(4,'ERROR: upload failed'); 59 59 $upload_status = parse_upload($result); … … 126 126 } 127 127 128 function upload($url,$session_id,$tar_gz_path) { 128 function upload($url,$session_id,$tar_gz_path,$session_dir) { 129 $body_s = ''; 130 $body_s .= file_get_contents("$session_dir/README"); 131 $body_s .= "<h2>License:</h2>\n"; 132 $body_s .= file_get_contents("$session_dir/LICENSE"); 133 $body_s .= "<h2>Transcriptions (i.e. the prompts file):</h2>\n"; 134 $body_s .= file_get_contents("$session_dir/prompts"); 135 $body_s = preg_replace("/\n/m","<br>\n",$body_s); 129 136 $post_a = array( 130 137 'func' => 'editSave', … … 133 140 'proceed' => 'showConfirmation', 134 141 'title' => "voxforge-ivr-$session_id", 135 'content' => 'automated submission; see .tgz for details', 136 'contentType' => 'text', 142 'content' => $body_s, 137 143 '__storageId_action' => 'upload', 138 144 'storageId_file' => "@$tar_gz_path", … … 140 146 'submit' => 'save', 141 147 ); 148 142 149 $ch = curl_init(); 143 150 curl_setopt($ch, CURLOPT_COOKIEJAR, "my_cookies.txt");