Jump to content

Need your help – moving files after upload


Adam Kiss
 Share

Recommended Posts

Hi,

I have a problem with one of my servers, which is running PW2. I want to upload new picture, but system gives me:

Unable to move uploaded file to: /var/customers/webs/brroc/ozzo/site/assets/files/5844/think.png

Even though every directory in path /site/assets/files/5844/ is chmodded to 777? It was previously set to 766, but during testing I set every one to 777.

I already wrote to server guys to check if we didn't ran out of server quota or do not have some very restricted access on our user.

If it's not it, what may I do?

Adam

Link to comment
Share on other sites

Hi Adam,

Didn't we find before that if one of the parent dirs lacked "x" permission for apache, that this could happen? I don't recall exactly, but it seems like there was something like that happening on one other person's hosting account.

Do you have shell access? i.e. could you chmod -R og+rwx in /site/assets/ to test?

Otherwise, I think you may be right about server quota or possibly something in the PHP settings. Have you looked at all file upload related settings in phpinfo?

Ryan

Link to comment
Share on other sites

Hi ryan,

as I wrote you, every directory along the path [/site/, /site/assets/, /site/assets/files, ...] has 777 as mod [set via FTP app], so I'm positive, that I did everything I could. Isn't there something in my code I can do to turn on some 'moar' error messages, e.g. more detaild description of what happened?

Adam

Link to comment
Share on other sites

Adam,

Have you set $debug = true in /site/config.php? Though the error message you reported is fairly specific, so I'm not sure it's going to get any better than that. What you may want to do is try putting a test file on the server in the web root and then loading it from your browser. I'm guessing it'll report the same problem, but running this test at least allows us to rule out some things. Let me know what it does.

/test.php

<pre>
<?php
error_reporting(E_ALL); 
ini_set("display_errors", 1); 
$target = "./site/assets/files/1/test.php";
copy("./test.php", $target); 
if(is_file($target)) {
   echo "\nfile was copied";
   unlink($target); 
} else {
   echo "\nfile was not copied -- what error message did you get?";
}
Link to comment
Share on other sites

  • 2 weeks later...

Unable to move uploaded file to: /var/customers/webs/brroc/ozzo/site/assets/files/5844/think.png

Where is the file uploaded at first ? That is, before being moved to site/assets/files/... ? *Moving* implies copying then deleting the original file so the original file could be in a (temp ?) folder that is not chmoded to 777 ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...