I am working on a project, which has a section to upload any type of documents.
On my server, I have a document table, with a blob type field.
I have managed to upload any type of document, smaller than 1 Mb, and then be able to download and view it.
My problem is that when I upload a document with a size larger than 1MB, the post function returns this error:
-tsneterr: (28) Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds
This is my code on the upload document button:
Code: Select all
on mouseUp
answer file "Seleccione archivo." with specialFolderPath("Desktop")
put it into tPath
put url ("binfile:" & tPath) into tBinaryData
put base64Encode(tBinaryData) into tDocumentBase64
put coreUpdateRelatedRecords("documents", tRecordId, tDatagridData) into tResult
end mouseUp
function coreUpdateRelatedRecords pRelatedTable, pRelatedRecordId, pDataArray
put "updateRecord_" & pRelatedTable & "_" & pRelatedRecordId into tTask
put httpsApiClient_sendRequest(tProfile, tTask, pDataArray) into tResponse
end coreUpdateRelatedRecords
I publish a piece of the code of the function httpsApiClient_sendRequest, which is the part where the post is made to the url, and it returns the error
Code: Select all
function httpsApiClient_sendRequest pProfile, pTask, pDataArray
....................................
..................
............
post compress(tStringToPost) to url s["profiles"][pProfile]["api_url"]
put it into tResponseJson
put the result into tResult
...............
.......................
...............................
end httpsApiClient_sendRequest
-tsneterr: (28) Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds
My question is this . Im doing the right way to upload a file ..? If its the right way, why cant I upload large files ..?
Thank you very much in advance