curl-and-php
PHP, libcURL, and FTP login problems
Date: Wed, 11 Aug 2010 14:16:48 -0700
Greetings, list
I am a bit of a neophyte when it comes to heavy-duty web programming (which this is not), so please bear with me.
I have a bit of code that is supposed to take a user's uploaded file and, using libcURL, send it to a remote server which has an FTP set up. The FTP uses a username and password, and is not set to receive anonymous connections. The code that I am using is pretty much an exact copy of the example code on the cURL site (http://curl.haxx.se/libcurl/php/examples/ftpupload.html) except that it is die($error)-ing on errors at the moment while I test.
I set the FTP URL to make sure I have that right, and I get the error I was expecting: login denied (67). So far, so good. The problem comes in when I uncomment the username and password; then, instead of a "could not log in" error, I am for some reason getting a "could not resolve host" error (6). I have tried hard-cording the username/password instead of using the variables, removing the { } from the $remoteurl, and commenting out and removing the remotepath, none of which did anything.
Is there a better way to add in the username and password, and/or can anybody figure out why it's doing this? Cheers. :)
(I am on Windows Server 2003, IIS6, and PHP 5.2.6, if that is germane.)
Stewart Baker
Cal State Dominguez Hills
University Library
Web Services / Reference Librarian
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2010-08-11