Jump to content

FTP/PHP file upload quandry


Raconteur

Recommended Posts

Hi gang,

I am hoping someone can point me in the right direction here...

I have a CMS that allows us to upload images to be shown on our site, which uses the PHP file upload mechanism (input field of type "file" and the ENCTYPE="multipart/form-data" in the form tag). This works wonderfully, with one exception. The script runs on the Unix server as "nobody", which means whenever I want to modify, move, download or delete the file, I cannot because I FTP in under a real user.

So, I thought, well, I will just bypass the PHP form upload stuff, and use the basic PHP FTP stuff. But I cannot get that to work either... Here is my code for that:

[a href=\"http://pastebin.com/712159\" target=\"_blank\"]http://pastebin.com/712159[/a]

Using the ftp_put method, everything seems to play well, but I get the "FTP upload has failed!" error after checking the value of $upload. I thought maybe this was because the $localFilePath was just the name of the file, so I hard coded the path and file name, but got the same error.

Then I tried ftp_fput, but got errors trying to open the file with fopen...

Basically, all I need to do is find a way to upload files to our site and make the owner an actual user, rather than "nobody" as PHP scripts run as.

Any help out there?

Thanks a million... this is driving me nuts!

Cheers,

Chris
Link to comment
https://forums.phpfreaks.com/topic/12123-ftpphp-file-upload-quandry/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.