How to upload a file using Java HttpClient library working with PHP

前端 未结 10 2278
旧巷少年郎
旧巷少年郎 2020-11-22 08:48

I want to write Java application that will upload a file to the Apache server with PHP. The Java code uses Jakarta HttpClient library version 4.0 beta2:

impo         


        
10条回答
  •  Happy的楠姐
    2020-11-22 09:08

    If you are testing this on your local WAMP you might need to set up the temporary folder for file uploads. You can do this in your PHP.ini file:

    upload_tmp_dir = "c:\mypath\mytempfolder\"
    

    You will need to grant permissions on the folder to allow the upload to take place - the permission you need to grant vary based on your operating system.

提交回复
热议问题