Share ideas, ask questions, and get feedback about developing for ProcessMaker

Moderators: ArturoRobles, ArturoRobles

Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
I need some help with uploading a document as input document via API as described in the PHP example at this link: ... t-document

No matter what I'm doing, I keep getting the error: 400, Bad Request: This filename does not exist!.
When looking into the PM classes seems like the $_FILES is always empty. I'm new to APIs, I have no idea how debug further.

Please, let me know if anyone managed to use that piece of code to post an input-document (from another machine).

Hi Amosbatto,

I'm using for saving file and passing path as parameter.
"tas_uid": "24322509756bc1b5012c202012716621",
"app_doc_comment": "test",

Response:- "message": "Bad Request: This filename does not exist!"

Can you suggest me ,what's the issue and how to solve? Please.....

I'm uploading file by using REST API while posting everything is fine but request status is 302 Found.
Please find attached Screen shot for API Request.
Post Data.png
Post Data.png (28 KiB) Viewed 2862 times
Post Data are below:-
Content-Disposition: form-data; name="0"; filename="Capture.PNG"
Content-Type: image/png


Content-Disposition: form-data; name="inp_doc_uid"

Content-Disposition: form-data; name="tas_uid"

Content-Disposition: form-data; name="app_doc_comment"


After That i'm not receiving any Response
& Request Status 302 Found.
Can anyone help in that?

Thanks You
FelipeSolis wrote:Hi, I'm facing this problem with .NET too. API always return file does not exist. I would like to know if there is another way to upload the file input
Are you trying to use a web uploader like this or are you trying to run a script which uploads a file which already exists on the computer? Post your code. I don't know anything about .NET, but maybe I can spot something if I look at your code.
You can upload documents by using MultipartFormDataContent in C#. This was all done in ASP.Net Core, but it should work for some of the older .Net MVC versions as well.
Code: Select all
public async Task<ActionResult<JObject>> UploadFile()
        using (HttpClient client = new HttpClient())
        using (var formData = new MultipartFormDataContent())
            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer",  authToken);

            formData.Add(new StringContent(documentUid), "inp_doc_uid");
            formData.Add(new StringContent(taskUid), "tas_uid");
            formData.Add(new StringContent(documentComment), "app_doc_comment");

            string filePath = Path.GetFullPath("/path/to/file.jpg");
            FileStream fileStream = new FileStream(filePath, FileMode.Open);

            formData.Add(new StreamContent(fileStream), "form", "file.jpg");

            HttpResponseMessage response = await client.PostAsync("{caseId}/input-document", formData);

            string responseString = await response.Content.ReadAsStringAsync();

            JObject responseJson = JObject.Parse(responseString);

            if (!response.IsSuccessStatusCode)
                return StatusCode((int)response.StatusCode, responseString ?? response.ToString());

            return Ok(responseJson);
You can also check out this Stackoverflow answer if you need to work with the file bytes rather than the file stream.

Hello, I'm trying to make a HTML page in which a[…]

IOS PUSH Notification

Latest Mobileios.pem already get its SSL cert expi[…]

Enabling SQL Server in Windows


PM 3.5.0 supports MySQL 5.7.X configurations with […]