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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.