Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

113
Views
How to send an audio file in Cordova using ajax?

Is there any way to send a mp3 file to server in Cordova using ajax?

Thanks.

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

You have use cordova-file-transfer plugin

Example:

var transfer = new FileTransfer();
transfer.upload(FILE_ABSOLUTE_PATH, "http://example.com/upload", function(sucess){
  // success callback
  console.log(success);
 }, function(fail){
  // failure callback
  console.error(fail);
 });

example on absolute path in Android : /storage/emulated/0/Android/data/.....

over 4 years ago · Santiago Trujillo Report

0

use cordova-file-transfer plugin

over 4 years ago · Santiago Trujillo Report

0

Thanks. I had seen that. But i had a problem when i tried to save the mp3 file on back-end.

I'm using this java rest (using MultipartHttpServletRequest):

@RequestMapping(value="/{clientId}/conversation/", method = RequestMethod.POST)
        @ResponseBody String chat(@PathVariable("clientId") String clientId, HttpSession session, MultipartHttpServletRequest request){}

But i don't know how to save this mp3 file on disk? Do i need to apply some Encoder?

Note: In Cordova i used options.mimeType="audio/mpeg";

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!