Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to automatically log in to an FTP site? 2

Status
Not open for further replies.

JBijleveld

Programmer
Apr 5, 2001
8
0
0
NL
Hi, I wonder if it's possible to use this technique to automatically log in to an FTP site to allow users to upload files.

I would like to create a so-called dropzone where visitors can drop off files for me. Uploading using HTTP is really slow and doesn't allow bigger files to be uploaded due to constraints of the hostingprovider (which he does NOT want to change).

I would like to see that I can supply the user with a password, then check it in some page and have the page log in to an FTP site with the appropriate rights, just as is the user did, so he can then drop files off.

Does anyone know if it's possible and if so, how to do this??? I would be most gratefull if anyone had some sample code to do so!

Regards,
J.Bijleveld
The Netherlands ---------------------
Abyss I.T. Solutions
 
You could use PHP's ftp commands
(PHP has to be built with the --with-ftp option).
But you would still be relying on the HTTP upload since you want the users to access this through web pages. The use would supply the name/password. HTTP upload the file ... then the with FTP commands, PHP would place the file in the appropriate server/folder .... this is only needed if the FTP server is not the Web server.

If you want to NOT use HTTP uploads then the best option would be to set up an FTP server. Each user would have their own name/password which would be tied to their home directory. The users would have to use some FTP client (WSFTPLE works well) to upload the files.
 
Thanks for the information!
However, I would like to be able to present my users with an FTP page where they can just drop their files on, not using HTTP upload. This is because my hosting provider has set the upload limit for HTTP to 2 MB, which is not enough for my application.

I also encounter a lot of trouwble uploading files with HTTP. Uploads get aborted frequently.

Would it be possible to have the PHP page log in for the user and then present an FTP page to the user by redirecting him to an FTP location? ---------------------
Abyss I.T. Solutions
 
you could probably get the page to login for the person using cookies.....but they would have to enter their username and password at least once.
 
cant u refer to an ftp page with anonymus ftp running on ure server?
ftp://mydomain.tld?? mcvdmvs
-- "It never hurts to help" -- Eek the Cat
 
mcvdmvs,

I do have an anonymous FTP site with my hostingprovider but it doesn't allow anonymous uploads, only downloads. That's for security reasons they say, but I do provide security with my own password check.

I did find a PHP function to use FTP uploads but it seems like that function first uses HTTP to get the file uploaded and THEN transfers it to its final destination using FTP, meaning it's not usefull for me.

Thanks for your answer, I hope you have another suggestion,
Regards,
Jeroen Bijleveld
---------------------
Abyss I.T. Solutions
 
If you are using the browser to do the ftp, it will use HTTP, no matter what you do.

Either use an FTP client (dedicated) to do the ftp
or use HTTP to ftp.

Can't have ftp through browser to ftp.
 
Hi,
I have a similar problem. I want to upload a file to my server. I have the userid/pwd. I want to automate the process. Something like, i will click on a batch file which should ask me for a password. When i supply a valid password it should upload the file. The file name and the source directory are assumed to be non changing and fixed and known.Is such a thing possible???
I achieved until this:I created a batch file. In that only i have hardcoded username and pwd.

ftpBatch.bat
=============
cd c:
ftp -s:%0
goto done
open xxx.xxx.xxx.xxx(IP add)
user
pwd
cd DESTINATION_DIR
mput file1.txt
y
bye
:done
========================
Instead of hardcoding i want it to be atleast a command line parameter which can be run using:
C:\> ftpBatch.bat pwd

Any inputs will be highly appriciated....

Thanks and Regards,
Srinath Thanks and Best Regards,
Srinath M.K
srinathmk@indiainfo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top