I have a input type file placed in a UIWebview. When a user selects a file from the iPad/iPhone, I need to save the file to my remote server. I have tried to encrypt the file to base64 and then using jquery ajax, send it to the API that decodes the file and then saves it to the server folder. But when as I encrypt the file, and make the ajax call, my ajax success function returns 'Undefined' may be because the size of the data that I send(base64 string) is too large.
$.ajax({
type: 'POST',
contentType: 'application/json; charset=utf-8',
url: 'https://www.myserver.com/api/Controller/Method',
data: JSON.stringify({Filename: "base64 string" , Questionid: '28faf0fb-9d12-477c-ada5-2adc816063c7' , FileExt: "png" ,sid:'45bdd775-477d-4ca2-9d89-9724366aec36'}),
processData: false,
dataType: 'json',
success: function(response) { alert(response); },
error: function(xhr, ajaxOptions, thrownError) {alert(xhr.responseText); }
});