Paniz
Paniz

Reputation: 604

Jmeter FTP request in passive mode

I am sending an FTP request using Jmeter. I just set the IP address and the jmeter in default send the file on port 21 and the server does not accept the file. But I want the process be passive which means the client negotiate with the server and after assigning a port number the file be sent on that.
How should I set it in Jmeter?
Also I have read this post which says the default mode is passive but it is not true for my case.

Upvotes: 1

Views: 997

Answers (1)

Dmitri T
Dmitri T

Reputation: 168197

  • JMeter establishes connection with the FTP server on port 21 (command channel). If your server is listening on the different port - use Port Number input to configure it.

    JMeter FTP destination command port

  • JMeter is configured to use local passive mode as it evidenced by the next line:

     ftp.enterLocalPassiveMode();// should probably come from the setup dialog        
    

    in the FTPSampler source code

  • FTP server should tell JMeter a higher port for the data channel for file transfer

Assuming you

  1. Provide path to existing local file
  2. Tick put(STOR) box
  3. If your file is not text-based tick Use Binary mode
  4. Provide correct destination and credentials

you should be able to upload the file successfully. If you experience problems - implement the upload request using JSR223 Sampler and Apache Commons Net FTP libraries and enable debug logging to see where exactly your problem is.

References:


If you are not able to establish the connection with the FTP server on port 21 - you won't be able to proceed.

Upvotes: 0

Related Questions