Lucinda Alves Posted May 12, 2017 at 10:47 AM Report #604167 Posted May 12, 2017 at 10:47 AM (edited) Olá Pedia a ajuda de alguém na seguinte situação: tenho um gravador de video... Grava bem e consigo sacar o que chamam de blob Depois preciso de fazer upload do ficheiro para uma pasta... Não estou a conseguir... Tentei creando um form por javascript e tentei mandar por ajax a informação mas não devo estar a fazer bem... Depois tentei criando um form no html com um campo de input file invisivel e fazer o post alterando o value, mas dá sempre erro... Alguém me pode dar um ajuda, por favor? Deixo o código que já tenho: player.on('finishRecord', function() { var myBlob = player.recordedData; var blob = myBlob.video;// Object[video: blob] var url = URL.createObjectURL(blob); var fileType = blob.type; var blobFile=url+".webm"; $("#video_blob").val(blob); $("#form_video").submit(); } Já tentei passar o blob, o url, etc... e nada... Muito obrigado Lucinda Alves Edited May 12, 2017 at 11:39 AM by Lucinda Alves
Lucinda Alves Posted May 12, 2017 at 11:29 AM Author Report #604168 Posted May 12, 2017 at 11:29 AM Já consegui por a funcionar com FormData e Ajax... var formData = new FormData(); formData.append('video_filename', fileName); formData.append('video_blob', blob); $.ajax({ url: 'save.php', data: formData, type: 'POST', contentType: false, // NEEDED, DON'T OMIT THIS (requires jQuery 1.6+) processData: false, // NEEDED, DON'T OMIT THIS // ... Other options like success and etc success : function(data){ alert(data); } });
devgoncalo Posted May 12, 2017 at 01:17 PM Report #604174 Posted May 12, 2017 at 01:17 PM ola curiosidade: o mysql permite guardar um blob na bd - https://dev.mysql.com/doc/refman/5.7/en/blob.html cumps
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now