0

i used recordRtc to record a video successfully , now i need to upload this video directly to a spêcific folder , lets say folder name is "c:/FOLDER1" , how can i achieve that?

here is my code:

mediaRecorder.onstop = (ev)=>{    
        let blob = new Blob(chunks, { 'type' : 'video/mp4;' });
        chunks = [];
        let videoURL = window.URL.createObjectURL(blob);
        vidSave.src = videoURL;  
         var file = new File([blob], 'video.mp4', {
             type: 'video/mp4'
         });
        invokeSaveAsDialog(file);
    }

Because this function invokeSaveAsDialog(file) download it directly and i cant chose where i want to download.

James Z
  • 12,209
  • 10
  • 24
  • 44
kan zied
  • 91
  • 8
  • 2
    Specifying download location dialog is completely browser dependent. Through Javascript, you cannot specify a user's location to download files. so you should let user choose where to save the file – Mustahsan Feb 24 '20 at 10:49
  • Ok , Is there a way since i have the blob ready and the Object file ready can i upload them directly to "C:/MYFOLDER" ??? – kan zied Feb 24 '20 at 10:56
  • no its not possible with javascript, although you can have a backend which can do this for you, in NodeJS or java etc, you can send this blob through API to backend and backend saves it in your C folder – Mustahsan Feb 24 '20 at 11:02
  • yes exactly man , i have a jhipster back end project (java) which i need to send this video to , PLEASE i didnt know how to send this blob in a post request , please man can u tell me how? for the front and the back – kan zied Feb 24 '20 at 13:01
  • Does this answer your question? [Download A File At Different Location Using HTML5](https://stackoverflow.com/questions/34870711/download-a-file-at-different-location-using-html5) – Heretic Monkey Feb 24 '20 at 15:41

0 Answers0