tags:

views:

261

answers:

4

I try to upload a file through PHP's ftp_put function, like so:

ftp_put($this->conn_id, $rempath, $locpath, $mode);

However I get the error "Cannot STOR." Nothing more. The FTP-connection is OK since I can download files using the same settings and ftp_get(). The script should be OK as well since it works fine on my local setup but not on my public server.

What can I try to make it work? I Googled but found nothing of worth.

A: 

Sounds like a permissions error. Are you sure you have permissions to upload the file to the location you are trying to put it at? If you try to do the upload manually via FileZilla or something does it work?

Eric Petroelje
Yes, there's no problem with my FTP-client nor my local Apache-server.
Christoffer
A: 

Cannot STOR is a permission issue. Doublecheck the permissions for the FTP user.

code_burgar
The same connection settings has been used before with great success. And this occurs on ALL Ftp accounts I try, on different servers.
Christoffer
A: 

You should check to be sure you have write permissions on the directory into which you are trying to put the file(s).

Doug Hays
As I said, using the exact same settings I'm able to perform FTP-upload from my local Apache, but not the production server. Which is very wierd if this indicates a permission error.
Christoffer
+1  A: 

You should first check to make sure that you are able to upload using a regular FTP client. I see you say "there's no problem withmy FTP-client" but in the initial request you said you are able to download files successfully and failed to mention a successful upload. I believe you will find that uploading with a client will fail too because that message is the output of FTP and not PHP. Whether or not it is a permissions issue remains to be seen, but it is unlikely a PHP issue. Do a little more research on FTP error 550.

Good Time Tribe