WordPress.org

Support

Support » How-To and Troubleshooting » The uploaded file could not be moved

The uploaded file could not be moved

  • Hello all,
    I have just installed wordpres on a live server and I now get this message :

    The uploaded file could not be moved to D:\inetpub\webs\magmalabnet\wordpress/wp-content/uploads.

    I have read some topics I have found with the search on thi forum, but none gave me a clue.
    My permissions are OK, my files re-uploaded,and the path is saved.

    The strange thing in the error is the BACKSLASH (note that it gets reveresd..) if i manuelly reverse the backslash, it will reverse it still puts the first one in the wrong direction…
    anyone had a clue on how to solve it? or is it really a part of the problem ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • Could you elaborate on “the permissions are OK?” What are they and, more importantly, does whatever user the web server use have Write permissions?

    permissions are ok means they are all 777 on all files and folders from level /wordpress..
    But somehow , like I said, the BACKSLASHES are reversed,producing an invalid path.
    I even tried to change the code in function.php line 977 from

    $path = str_replace(ABSPATH, '', trim(get_option('upload_path')));
    	$dir = ABSPATH . $path;
    	$url = trailingslashit($siteurl) . $path;
    
    	if ( $dir == ABSPATH ) { //the option was empty
    		$dir = ABSPATH . 'wp-content/uploads';

    to :

    if ( $dir == ABSPATH ) { //the option was empty
    		$dir = ABSPATH . 'wp-content\uploads';

    or:

    if ( $dir == ABSPATH ) { //the option was empty
    		$dir = ABSPATH . '\wp-content\uploads';

    but also that does not help .

    whooami

    @whooami

    Member

    permissions are ok means they are all 777 on all files and folders from level /wordpress..

    lol. and what told you those are okay permissions?

    Fir starters, those are completely not-okay permissions, and a good deal of hosts block scripts from working when world writable files are in use.

    You do NOT need to have your entire WordPress install set up like that. PLEASE try to educate yourself.

    Say, clearly you’re on a Windows server. Are you running IIS or Apache?

    the permissions were 775 before i changed them to 777.
    I have a question that might sove my problem.
    if i change ine 976 in functions.php to

    if ( $dir == ABSPATH ) { //the option was empty
    		$dir = 'D:\inetpub\webs\magmalabnet\somedirectory';

    The uploads works fine.
    but then the WYSIWYG editor does not see the file, and does not POST it, instead it gives me only the link in the post and in the editor i see double backslash.
    like this guys problem :

    LINK

    so the question is:
    Where do i define a GLOBAL upload dir that will not depend on ABSPATH but will be recognized as such by all the functions/scripts/pugins?
    can I define souch a path to be OUT of the wordpress tree of hirerchy ?

    I have the same problem and could not able to find a solution. I’m a windows server user and geting the same error message.

    The uploaded file could not be moved to D:\inetpub\…\…com\www/wp-content.
    I think the problem cause from the ‘www/wp-content’ the ‘/’ should be ‘\’

    where can i change it ?

    I have JUST finished wrestling this problem to the ground.

    I had the exact same symptoms. All WP DB access actions were working just fine, but when it came to editing WP filed directly, nothing seemed to work!

    I used Filezilla to change permissions to the very unwise, but shotgun solution of “777” for ALL WP files.

    Nadda.

    Turns out the solution was that filezilla is not very good at changing permissions correctly. I had to go in through the Control center for my web server to edit permissions in order to get it all sorted.

    Hope that helps someone else in the same boat!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘The uploaded file could not be moved’ is closed to new replies.
Skip to toolbar