PDA

View Full Version : Ext.Ajax.request param length limit?



dilyanbg
16 Jun 2015, 5:58 AM
Hello,

Is there some limit of the length of param in Ext.Ajax.request?

The variable file is an image and it's string ("file:data:image/png;base64,iVBOR...") is 25422214 characters long.

Second question: Why I can upload the same file via form (with filefield) submit but with AJAX I'm getting "net::ERR_EMPTY_RESPONSE" error?

My code:


Ext.Ajax.request({
url: InterfaceConfig.pathImageUploadController, // url to php file
method: 'POST',
params: {
file: file
},
success: function (response, request) {
//...
},
failure: function (response, request) {
//...
}
});

Gary Schlosberg
16 Jun 2015, 3:49 PM
I've moved your post to the Ext 4 forum, as requested.

Do you get that error message right away or does it take time to return?

dilyanbg
16 Jun 2015, 11:09 PM
I've moved your post to the Ext 4 forum, as requested.

Do you get that error message right away or does it take time to return?

Hi Gary, thank you for moving the post on the right place.

It takes time to return the error message (about 30 seconds). The request status is "failed" - status 0 and responseText is empty.

As I recently researched - there is not POST size limit in HTTP. That's why I'm trying to understand if ExtJS have some limitations.


I'm using Apache server and PHP. Also I'm sending the request to php file which is on the same domain. In PHP I have changed the limits (just for the tests) of the following so:


ini_set('memory_limit','4000M');
ini_set('max_execution_time','300');
ini_set('max_input_time','300');
ini_set('post_max_size','257M');
ini_set('upload_max_filesize','256M');


The content type of the request is: application/x-www-form-urlencoded

In the Apache config I have: LimitRequestFieldSize 16380 but I don't have any LimitRequestBody. I don't have permission to change the Apache config and nobody will change it for me just for tests.

I have successfully sent the same request via Postman (chrome extension).

Now I'm splitting the string into 5 chunks and then making 5 AJAX requests... then concatenate the string in PHP. But it sounds unnecessarily to me. I know that there is better way.