Cykod FlashWavRecorder PHP save - upload to server problem -
I believe that I am most definitely configured for the recorder because I can get Flash permission 1 - Start recording 3 - Listen to playback, but when I go to save the file So I can not get it in the upload directory nor on the temp dir. I know php is working because i have successfully tested a post-upload form here html and php: & lt ;! DOCTYPE html & gt; & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" lang = "en" xml: lang = "en" & gt; & Lt; Top & gt; & Lt; Title & gt; My Recorder & lt; / Title & gt; & Lt; Script src = 'http: //ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js'> & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "js / swfobject.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "js / recorder.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; $ (Function () {var appWidth = 24; var appHyight = 24; var, Flashvars = {'event_handler': 'microphone_recorder_events', 'upload_image': 'image / upload'}} var params = {}; var properties = { 'Id': "recorderApp", 'name': "recorderApp"}; swfobject.embedSWF ("recorder.swf", "Flash content", app with, app, "10.1.0", "", flashwars, parameter, Features );}); & Lt; / Script & gt; & Lt; Style & gt; #control_panel {white-space: nowrap; } #control_panel one {framework: none; Display: Inline-block; Width: 24px; Height: 24px; } #control_panel_img {border: 0; } #save_button {status: Completed; Padding: 0; Margin: 0; } #play_button {Display: Inline-Block; } & Lt; / Style & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "status" & gt; Recorder status ... & lt; / Div & gt; & Lt; Div id = "control_panel" & gt; & Lt; An id = "record_button" onclick = "recorder. Record ('audio', 'audio.wow');" Href = "javascript: void (0);" Title = "record" & gt; & Lt; Img src = "picture / record" width = "24" height = "24" alt = "archive" /> gt; & Lt; / A & gt; & Lt; Span id = "save_button" & gt; & Lt; Span id = "flashcontent" & gt; & Lt; P & gt; Javascript enabled and Adobe Flash Player installed, please & lt; / P & gt; & Lt; / Span & gt; & Lt; / Span & gt; & Lt; An id = "play_button" style = "display: none;" Onclick = "Recorder.playback ('audio');" Href = "javascript: void (0);" Title = "play" & gt; & Lt; Img src = "picture / play png" width = "24" height = "24" alt = "play" /> gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; Div id = "upload_status" & gt; & Lt; / Div & gt; & Lt; Form id = "upload form" name = "upload form" & gt; & Lt; Input name = "authentication_token" value = "xxxxx" type = "hidden" & gt; & Lt; Input name = "upload_file [parent_id]" value = "1" type = "hidden" & gt; & Lt; Input name = "format" value = "json" type = "hidden" & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt; & Lt ;? Php $ save_folder = dirname (__ file__). "/ Audio"; If (! File_exists ($ save_folder)) {Failure to create $ save_folder ("Mkdir ($ save_folder)" (dead ("save folder" save_folder);}} function valid_wav_file ($ file) {$ handle = fopen ($ File, 'r'); $ header = Fred ($ handle, 4); list ($ chunk_size) = array_values (Unpack ('V', Fred ($ handle, 4)); $ Format = fread ($ Handle, 4); fclose ($ handle); $ header == 'RIFF' & amp; amp; $ format == 'Wave' & amp; $ chunk_size == (filesystem ($ file) - 8);} $ Key = 'filename'; $ Tmp_name = $ _FILES ["upload_file"] ["tmp_name"] [$ s]; $ Upload_name = $ _FILES ["upload_file"] ["name"] [$ k]; $ type = $ _FILES ["upload_f" $ {File} = $ '$ save_folder / $ upload_name "; $ saved = 0; if ($ type ==' audio / x-wave '& amp; preg_match (' / ^ [A-zA-Z0-9 _ \ -] + \ .wav $ / ', $ upload_name) and valid_w__file ($ Tmp_name)) {$ saved = move_uploaded_file ($ tmp_name, $ filename)? 1: 0 ;} ($ _ POST ['format'] == 'json') {header ('content-type: app / jsn'); print "{\" saved \ ": $ saved}"; } And {print $ saved? "Saved": 'Not Saved'; } Go out; ? & Gt; BTW - This Cyclone came straight from the site, I did anything for it ... Also, how can I change the save button to MP3? Thanks!
Do not know if you ever got the answer, but check your folder permissions. After setting up my "Audio" folder, as everybody can read / write it, of course this is not the best way to do this - you need to make your Apache / php account writeable in the folder - but less At this you should go.
Comments
Post a Comment