JavaScript парсер бинарных данных
10 USDЗдравствуйте!
У меня возникла проблема с загрузкой бинарных данных к себе на сервер, поэтому прошу у вас помощи.
Суть проблемы в том что мне надо с помощью XHR сначала получить аудиофайл, а потом с помощью второго XHR запроса отослать его к себе на сервер (спарсить).
Проблема возникает при попытке получить данные у себя на сервере. Они либо искажены (если пытатся сохранить .responseText) поскольку JS работает только с кодировкой UTF-8, либо у меня возникают проблемы с извлечением данных на стороне сервера (PHP скрипта).
Ссылка на мои скрипты: http://file.sampo.ru/7f367j/
Вспомогательные ссылки с информацией:
1) http://www.html5rocks.com/ru/tutorials/file/xhr2/ ;
2) https://developer.mozilla.org/en-US/docs/Web/API/XMLH..
3) http://us2.php.net/manual/en/wrappers.php.php
4) https://learn.javascript.ru/ajax-xmlhttprequest
За помощь готов заплатить 5 долларов, если хотите больше - пожалуйста так и напишите указав сумму.
Спасибо за внимание! С уважением, Олег.
-
36 Попробую разбираться.
Для связи [email protected]
Есть вопросы.
-

Недостаточно информации. Скорей всего глюки при получении файла в XMLHttpRequest. Попробуйте в test_obj_send_v2 следующий код (писал "вслепую", поэтому может не работать):
//oReq.overrideMimeType('image/png; charset=x-user-defined');
oReq.overrideMimeType("text/plain; charset=x-user-defined");
oReq.onload = function(oEvent) {
//var formData = new FormData();
//formData.append('file', oReq.response);
var response = oReq.responseText;
var binStr = new Array(response.length);
for(var i = 0, len = response.length; i < len; ++i){
var ch = response.charCodeAt(i);
binStr[i] = String.fromCharCode(ch & 0xff);
}
binStr = binStr.join('');
var data = {
//file: oReq.responseText
file: binStr
}; -
Если у вас поток то зачем вы используете php вам нужно использовать sockets для потоковой передачи.
-
Current freelance projects in the category Javascript and Typescript
Full-Stack Developer Needed — Strapi CMS, E-commerce, Loyalty System & AI for Tourism Websites
2000 USD
Project Description: We're a tourism technology company managing multiple tourism and events websites worldwide. We're looking for an experienced freelance full-stack developer to help build and maintain the technical backbone of our platforms using Strapi CMS (headless… Content Management Systems, Javascript and Typescript ∙ 3 hours 57 minutes back ∙ 17 proposals |
Optimization of Core Web Vitals (OpenCart) for Google PageSpeed — Mobile and PC versionsOrder description: We are looking for an experienced frontend developer/OpenCart specialist to optimize the loading speed of the website (categories and product cards) according to Google Core Web Vitals requirements. About the project: * CMS: OpenCart. * Specifics: The site… Content Management Systems, Javascript and Typescript ∙ 1 day 22 hours back ∙ 17 proposals |
Optimization of WordPress site speed
113 USD
We will send full details in private messages Goal Maximize website loading speed, especially on mobile devices. KPI (mandatory) After the work is completed, the following metrics must be achieved. Mobile Performance 90+ LCP less than 2.2 sec INP less than 200 ms CLS less than… HTML & CSS, Javascript and Typescript ∙ 2 days 17 hours back ∙ 65 proposals |
Integration of a service cost calculator on the Webflow site
330 USD
We are looking for a developer to integrate a ready-made service cost calculator into our website, created on Webflow. About the company We are engaged in: furniture assembly; TV mounting; mounting shelves, pictures, mirrors, and other items; moving help; heavy lifting; handyman… Javascript and Typescript, Web Programming ∙ 2 days 18 hours back ∙ 64 proposals |
Looking for an Odoo Developer — a solo developer with experience in Odoo 19 Community Edition.There is a working, well-designed project on Odoo 19 Community — CRM for a Ukrainian hotel, already in production-grade infrastructure. We do not plan to rewrite from scratch. We are looking for one person who will take over the project, maintain the working state, and lead it… Javascript and Typescript, Web Programming ∙ 4 days 19 hours back ∙ 2 proposals |