help with imagecapture upload javascript/php/mediastream
Ngân sách $15-25 USD / giờ
- Freelancer
- Các công việc
- PHP
- 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);
?>
32 freelancer chào giá trung bình $22/giờ cho công việc này
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 Thêm
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 Thêm
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
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 Thêm
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 Thêm
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 Thêm
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 Thêm
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.
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 Thêm
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
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 Thêm
Hi Thanks for your job posting I can help you it . it will not take less than 3 hours thanks Viktor
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. Thêm
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.