Sorry it's me again :-O

I am in the middle of creating a download/upload management script.

Currently it has one upload method HTTP upload via HTML form which obviously is not good as users would be restricted by the PHP max upload size and script timeout issues and so on.

1) I hope this does not sound stupid, but can someone tell me if PHP built in ftp functions is also restricted to the max upload size etc in the php.ini :icon_question:

2) When uploading via ftp using php is the script dependant on the script timout etc that is also set in the php.ini :icon_question:

Sorry if these questions sound stupid.

3) Also i was reading on php.net/manual that php ftp functions are part of the php Windows enviroment also, so there is no need to install anything extra. I here so much about HTTP upload having problems with windows servers, will php ftp functions combat most problems that is occured using HTTP upload with windows server, like file paths etc, the script is going to be shared with people so need to ensure i can make it as compatible as possible. :icon_question:

4) In php is there a little script i can make to first check if php has ftp enabled, if so how do i do this check :icon_question:

5) When uploading via php ftp, will my php scripts be required to chmod the files beforehand so they can be renamed, deleted, edited via php, as the files will may need to be at somepoint renamed, edited, deleted etc :icon_question: ...
as i have been reading and from what i think i can understand that if a file is uploaded via ftp including php ftp a php script won't be able to do anything with the file, i am confused by this, so if anyone could explain in more detail that would be a great help.

Sorry for all the questions, and thanks for any replies, much appreciated.


First off. The FTP functions in PHP are server to server, and not client to server. Are you sure this is what you need ? Sounds to me you want to allow clients to upload to the server. If that is correct, then this is not a viable option.


I want clients to be able to upload from there computer (client) to the server. Problem is obviously the script is going to be used on different hosts with different settings so max upload sizes will be low. As the upload page is an admin page i thought php ftp would work like if i was using CuteFTP, FileZilla, only difference being i would enter ftp details on a (admin protected) page/form and i can upload from my computer to the server via a html form, that when submitted will upload file to the server via ftp not http

Maybe you could explain to me why it is not a viable option so i can fully understand and suggest a better upload method?

Thanks for your time.


If you want to upload data from a html page (client) to the server, you cannot use the ftp functions of php to do this. The ftp functions of php work from server to server, it has no knowledge of files being on the client. You'd probably need ftp functions in javascript, or a flash or silverlight plugin.

I've used plupload to upload lots of (large) files to my server, perhaps that could be an option.


Thanks for the explanation. I was wondering how i would manage to get the clients file directory to display when php is server side. That clears things up for me so thank you :)

The script i am developing is going to be used by others, i am worried about using other persons/companies scripts as i don't understand the licenses, they are all so confusing so don't know whether i can use as part of my own script and distribute freely to others free of charge of course. The license for that script is : GPLv2 , i know they display the license on there site but i don't understand it at all so don't know if i can do what i want above.


If you are thinking of selling your script, then GPL is not an option. If your script will be free to download and includes the source, you'll have no problems with it.

Perhaps this comparison will help a bit.

Thank you :)

I won't be selling it, it will be freely distributed to whoever wants it.

Thanks for the link helps me understand them now :