ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Option one can handle HTTP uploads as well as FTP, but will probably require more learning (you have to do most things through curl's setopt function, and there's a hell of a lot in there to read through).
Option two is easier, but only does FTP transfers.
Yes, the curl functions (link #1) will do that. Read through the docs, especially the setopt function, because that's where the functionality really is.
The best way to start would be to get file uploads working (from the PHP server preferably, if you have command line access) with the command line curl tool - this will give you a head start on figuring out which options you will need to set when you use the library functions. As soon as you can upload the file and have the JSP servlet receive it correctly, the rest is just grunt work.
Warning: fopen("example_homepage.txt", "w") - Permission denied in /var/www/html/testcurl.php on line 4
Curl (the PHP library part) is definitely installed - you can tell because curl_setopt returned a warning message rather than an "unknown function" error. The first error is the source of the problem - your PHP script is probably running as a user that doesn't have permission to read the file you want to upload. Do you have shell access to this server?