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 development — Amazon PPC Dashboard (Stage 1)Need a full-stack developer with experience working with Amazon API to implement Stage 1 of the internal PPC dashboard. The project is real, the data is live, everything is ready to start. Frontend prototype (5 pages, React + TypeScript): WHAT IS ALREADY READY — Frontend… Javascript and Typescript, Web Programming ∙ 7 hours 51 minutes back ∙ 16 proposals |
Development of a photo book and photo frame constructor websiteProject Goal A modern website needs to be developed for ordering photo books, photo frames, and other personalized photo products. The main task of the project is to provide the client with the ability to independently create a ready-made layout of the product directly on the… Javascript and Typescript, Web Programming ∙ 1 day 23 hours back ∙ 88 proposals |
Full-stack developmentNeed a full-stack developer who is free for work and not looking to get rich immediately from this project. This is my test site: readyhome.ge the prototype of which I want to create (not referring to design). In the footer, there is Russian language, fill out the questionnaire… Javascript and Typescript, Web Programming ∙ 2 days 12 hours back ∙ 79 proposals |
Team for a custom marketplace of funeral services.We are looking for a team to launch and develop a custom national marketplace for funeral services. Right away: we are not looking for solo freelancers, juniors, or "website builders." We need a strong product team at the middle+/senior level with real cases in… Javascript and Typescript, Web Programming ∙ 2 days 18 hours back ∙ 25 proposals |
Improvement of the existing Next.js/Supabase project: offers, CRM, analytics, AI chatThere is an active project WatchGenius — a luxury watch analytics platform with a catalog of models, price analytics, external offers, application forms, and an AI chat. The project has already been partially developed. We need not a website from scratch, but an experienced… Javascript and Typescript, Web Programming ∙ 4 days 19 hours back ∙ 54 proposals |