How to put file in runner that runs on a Linux

Hello Apidog support team,

I need to send a file as a parameter in a POST request for scheduled tests that run in Docker on a Linux server. I know the file must be placed inside the container, but I’m not sure how to reference or configure it properly in the test environment. Could you please provide guidance on the correct way to include the file in the container?

Hi there! :wave: You can send a file as a parameter in Apidog by following these steps:

  1. Create a POST or PUT request.
  2. Set the Body type to form-data.
  3. Add a parameter and set its type to File.
  4. Click Choose File to upload.
  5. Click on Bulk Edit, which will open another window. Here, you can set the file parameter’s value to a variable.
  6. Send the request.

This will allow you to send a file through the parameter successfully. Let me know if you need further assistance!

That’s great, but how do I insert this request into a scheduled test that is running in the docker on our server? If I put it in like that, the test fails because it can’t find the file, which is understandable. So my question is, how do I put my file in the docker container with the test so that the test that runs in the docker can use it?

It looks like your test is running in a Docker container, and the issue is that the file isn’t available inside the container. If you’re running this test in a CI/CD pipeline or a runner, you’ll need to ensure the file is properly mounted or uploaded.

To resolve this:

  1. Put the required file in the mount data directory of your Runner.
  2. In the Apidog test scenario, locate the step details for the file upload request and click the “Batch Edit” button.
  3. Replace the file field parameter value with the file path in Docker (e.g., /opt/apidog/runner/yourfilename.jpg).
    Apidog’s CLI documentation for more details: Apidog CLI Options - Apidog Docs
    Let me know if you need further assistance!

Thank you very much. With your advice, I finally figured it out. Have a nice day. :slightly_smiling_face: