I’m going to be dealing with large files (max of 2GB) that clients will use to upload raw images/long pdfs/etc. I’ve read online that PHP isn’t the best solution but I can’t have every single client download an FTP program, have me make a username/directory for them, and give them a password just to upload a file once.
What I am asking is what is a better, faster function to use, or does it not matter? ftp_get() or move_uploaded_file() ? Is there a better way I can accomplish this using PHP?
I was thinking since it’s ftp that ftp_put would be faster and more viable, but i’m not really sure which is why I am asking this question.
Thanks for your input.
This is not the same job.
First case, your user upload a file directly to your server, and then you process it using
move_uploaded_file.Second case, your user upload a file to an FTP server, built for such uploads. Then, you’ll download a file that is generally on a remote server with a good bandwidth and upload speed.
A better solution should be to provide both options, according to the size of the file.
And you put your FTP in the same server as the web’s one, in such a way, you can access the file directly in the filesystem without
ftp_get, this should be even faster.