+ Start a Discussion

remoteFunction (multipart/form-data) - Read timed out

The AJAX Proxy remoteFunction fails when posting multipart/form-data. This may be related to a previousily reported bug: Bug #192181


Here is the remoteFunction code:

function uploadTest(){

var content = '--7777777';
content += '\r\nContent-Disposition: form-data; name="file"; filename="test.txt"';
content += '\r\nContent-Type: text/plain';
content += '\r\n\r\n Test Test Test';
content += '\r\n--7777777--';

url: 'http://test.com',
"Content-Type": "multipart/form-data; boundary=7777777"
requestData: content,
method: "POST",
onSuccess : function(response) {
alert("Success: " + response);
onFailure : function(response) {
alert("Failure: " + response);


And, here is the response:

<head><title>400 Unable to forward request due to: Read timed out</title></head>
<h1>400 Unable to forward request due to: Read timed out</h1>
<p /><hr />



When the remoteFunction method is changed to GET, the request is successfully sent to the host without the requestData.  A possible solution may be to allow the sending of requestData with a GET method or allowing multipart/form-data to be set as the Content-Type in requestHeaders.


Note: Sending the same request with an Apex HttpRequest works perfectly.  However, the 100kb size limit makes it a non-viable solution.


Any assistance in getting the remoteFunction to work properly would be greatly appreciated!







where are you uploading the documents ?.Can you explain elaborately.

...the files are being uploaded to a rest(ful) web service that returns XML in its response.  The issue I'm having is that the request is never made to the host (not leaving s/f) - I get a "Read timed out" error.  I'm thinking this might be a bug within the AJAX Proxy remoteFunction that is causing the request to fail?

I'm also seeing this issue, any news on this?
Message Edited by Teboda on 04-16-2009 01:17 AM


Can you post the code for to send(multipart/form-data) using HttpRequest.





Any solution on this so far. We can make calls for other services expect upload part, which is working in plain javascript ajax proxy or tools like postman (chrome extension). 

We are trying to upload multiple files to Alfresco DMS from a visualforce page through client browser using javascript/html5. So any help is really appreciate.