Closed

help with imagecapture upload javascript/php/mediastream

hi,

I am rtying to grab a picture from a live webrtc video stream transmitting to antmedia server every minute and upload it to a php file to be stored on disk.

I can get it to grab the picture and display it on the page but cant seem to be able to upload it correctly.

I always get empty files on the disk.

Can someone tells me how to correct this code so it uploads correctly !

I expect someone to quote me one hour only !

here is the javascript code i use to grab and upload it :

var firstVideoTrack;

[login to view URL]({ video: true })

.then(mediaStream => {

firstVideoTrack = [login to view URL]()[0];

});

var imageinterval;

var imageCapture;

var photo;

function captureimage(){

imageCapture = new ImageCapture(firstVideoTrack);

[login to view URL]().then(function(blob) {

photo = [login to view URL](blob);

[login to view URL]('capture').src=photo; // this works

var formData = new FormData();

[login to view URL](

"picture", blob

);

var xhr = new XMLHttpRequest();

[login to view URL]("POST", "[login to view URL]");

[login to view URL](formData);

})

}

and here is the php code [login to view URL] :

<?php

$img = $_POST['image'];

$folderPath = "upload/";

$image_parts = explode(";base64,", $img);

$image_type_aux = explode("image/", $image_parts[0]);

$image_type = $image_type_aux[1];

$image_base64 = base64_decode($image_parts[1]);

$fileName = uniqid() . '.png';

$file = $folderPath . $fileName;

file_put_contents($file, $image_base64);

print_r($fileName);

?>

Skills: PHP, JavaScript

See more: javascript upload finish php, file upload using php javascript, multiple upload progress bar javascript php, javascript php image preview upload, javascript file upload progressbar php, upload files javascript php, ajax upload javascript php, ajax file upload javascript php progress bar, multi image upload javascript php mysql, multi upload javascript php

About the Employer:
( 13 reviews ) prevost, Canada

Project ID: #28384269

32 freelancers are bidding on average $22/hour for this job

seekdeveloper

Hi, I have read your post and understood your requirement. Looking for the freelancer to work on your next project? Or just need some issues/bugs/fixes ASAP? I have 11+ years of software experience in fortune 500 comp More

$25 USD / hour
(119 Reviews)
8.8
tomydeveloper

Hello Buyer, Hope you are good, As I have gone through your requirements you are looking for a person who has extensive experience with WordPress/PHP and is able to code customizable WordPress themes and plugins and d More

$25 USD / hour
(338 Reviews)
7.9
tangramua

Hello Louis V.,   We have 20 years of strong experience in PHP, JavaScript, as a result, we can successfully complete this project.   Please, review our profile here: https://www.freelancer.com/u/tangramua Here detaile More

$25 USD / hour
(91 Reviews)
7.4
mmadi

Hello Louis V.. I'm interested in your job description. I am a detail-oriented developer who has 10 years experience of web development. I have top skills in JavaScript, PHP. I am pretty sure that I can provid More

$17 USD / hour
(50 Reviews)
7.1
einnovention

Hi there! I read your project of help with imagecapture upload javascript/php/mediastream I am in top freelancers and can do this in professional way! I will use PHP JavaScript WAITING FOR YOU IN CHAT BOX Best: AQEEL

$20 USD / hour
(153 Reviews)
7.2
HiFiDesigner

I can fix your upload image issue. Kindly check my reviews. My reviews show the quality of the services that I am offering to my clients. Also, kindly check my Portfolio site [login to view URL] I have also crea More

$25 USD / hour
(285 Reviews)
6.8
ambyt

Hello, I hope you are fine and doing well today. I have gone through the requirements. I would able to help the imagecapture and upload it with the javescript as per the specifications. I have rich experience as a fu More

$20 USD / hour
(38 Reviews)
6.3
yasirk1979

Dear Sir, I have read everything and it is not 1 hour job, so would you be flexible in it? I have 10+ years of experience working on different programming language, so i can assure you quality of work. Look forward t More

$20 USD / hour
(13 Reviews)
6.1
MarkoNikovic

Hello, I've seen your brief and I understood your specs of solving image capture using PHP I'll be able to provide you a project that will capture client's attention instantly and will be functionally sound. I 'm looki More

$20 USD / hour
(16 Reviews)
5.0
GenieCode

Hi! I'll FIX the IMAGE CAPTURE/UPLOAD feature and I'll charge just 15 USD. I'll START the work NOW. I'm an experienced website developer and I'm confident that I'm exact match for this position. I'll START working on More

$15 USD / hour
(43 Reviews)
5.1
(17 Reviews)
5.6
rkurilenko007

Dear Sir. Thanks for the opportunity to place bid on this project. I have read your description in carefully and so I think this project is perfect fit to me. I am a professional PHP and Javascript developer who can he More

$20 USD / hour
(26 Reviews)
4.9
dimakushkulov20

Hello I have checked your code carefully and realized that I can solve that problem. The post method on Javascript and the receiving in the PHP are wrong. Please contact me for the answer.

$25 USD / hour
(12 Reviews)
4.3
Dmytrokomp

Hello there. I can complete this project in 8 hours. I am Dmytro from Ukraine and I am familiar with some kinds of Images Uploading. With my skillsets, I make sure that I can help you perfectly and you will get satisfy More

$25 USD / hour
(8 Reviews)
4.4
yuliasukhoruchko

Hi, I am in agreement with an hour quote only. In my opinion, [login to view URL]("picture", blob); is the reason of empty file object. Could you show me the [login to view URL] for the blob parameter? BR, Yulia

$25 USD / hour
(5 Reviews)
4.0
BrokeProgrammer

Hey, We are pretty good at PHP and JavaScript. We have experience in domains like SaaS, Identity+Privacy+Security, AdTech+IoT, Construction, Real-estate, Non-profit, Social Platform, Recruitment, etc. We also help fu More

$25 USD / hour
(5 Reviews)
4.0
kalininexp

Hi Thanks for your job posting I can help you it . it will not take less than 3 hours thanks Viktor

$25 USD / hour
(3 Reviews)
3.8
demydkasilov

Hi, Good Client I have gone through your job description. I always propose in case I can do it I have super skill in PHP-Laravel-Wordpress-Javascript-React.js-Node.js. Skills : -Javascript/jQuery/React. More

$20 USD / hour
(7 Reviews)
3.8
tkachdm69

Hi, I am Dmytro. I have read your description very carefully and I'd like to discuss more about your project furthur. Beceause I have a some experience in WebRTC and good at Javascript and PHP, I think I can help you. More

$20 USD / hour
(6 Reviews)
3.5
valerykrapiv

Hello, Luois. What error do you get? I have rich WebRTC experience and I think I can do it. if you want to finish it in short time, please contact to me.

$20 USD / hour
(9 Reviews)
4.7