File has not been uploaded!

Feed 14 posts, 7 voices

Avatar
2 posts

I am having issues with uploading images in the cms. I keep getting this message “File has not been uploaded!” I was told that it could be my hosting service but I do not know. If anyone has any suggestions that would be great. Thanks

 
Avatar
1493 posts

Check the permissions on the folder. It should work with either “0755” or “0751”. It depends on how things work on your host. Of course, it is always possible to FTP files directly, but it would be more convenient for Frog’s own file manager to do the job, of course!

 
Avatar
2 posts

I checked the permission folder and everything is set to granted. I wanted to know what else I could do?

 
Avatar
4 posts

Try and enable debugging in the config.php file.

If your host is running in SAFE MODE ON there are a lot of restrictions: the upload directory and upload script has to be owned by the same user (not necessarily run by that user though).

Specifically, this gives you a problem if you use the webinterface to create a new dir:

1. the new dir is owned by the user running the webserver
2. When using the interface to upload to this dir, the uploader phpscript owned by you tries to write to the dir owned by the other user – this is not allowed with SAFE MODE ON

Workaround: create directories using ftp and make them writable.

 
Avatar
2 posts

I was told by the hosting company that the safe mode is turned off. They also said that in order for multiple users to update my image folders I would have to create a php.ini file. Does anyone know what that will do?

 
Avatar
58 posts

I have the same issue. Not one feature (rename, delete, create dir, upload file) have not working.
Just returns “Permission dined” or “File was not be uploaded” in CMS error reporting.

 
Avatar
4 posts

Aha…. “permission denied” tells you a lot, probably the user running the webserver (and executing the php scripts) is not the same as the user owing the directories/files (probably you).

Try and upload a small info.php script with the fabulous phpinfo(); command – and have a look the output – look for usernames in both script executor and script owner – and safe_mode.

I works for me, when I create subdirs using ftp, because then the php script uploading/renaming files works in a dir owned by the same user – and then it doesn’t matter that the user RUNNING the script (the www user) is different (safe mode on).

It is really difficult to say anything wihtout knowing the owners of the php scripts, the upload dir, the uploaded files etc.

 
Avatar
14 posts

I have just run into this issue with a client as well.

Can someone clarify the above steps mentioned?

  1. enable debugging, I have done this so what should I expect to see and where?
  2. upload info.php script, to what directory?

thanks

 
Avatar
1493 posts

1. enable debugging, I have done this so what should I expect to see and where?

You should only see PHP errors, and those appear on the pages where an error is thrown. It might not help in the case where the problem is simply a mis-match of permissions.

2. upload info.php script, to what directory?

Your Frog’s root directory would be fine: http://myfrogsite.com/info.php would do it.

 
Avatar
4 posts

info.php:

<?php  phpinfo();?>

Upload to frog root dir and call

http://www.yourdomain.com/path_to_frog_root_dir/info.php

 
Avatar
96 posts

Sounds like this might be a file size upload issue – see http://drupal.org/node/125252 for some tips.

 
Avatar
58 posts

When i try to upload a files over the file-manager i have a this (‘File has not been uploaded!’) answer:

    public function upload()
    {
        $this->_checkPermission();
        $data = $_POST['upload'];
        $path = str_replace('..', '', $data['path']);
        $overwrite = isset($data['overwrite']) ? true: false;
        if (isset($_FILES))
        {
            $file = upload_file($_FILES['upload_file']['name'], FILES_DIR.'/'.$path.'/', $_FILES['upload_file']['tmp_name'], $overwrite);
            if ($file === false)
               Flash::set('error', __('File has not been uploaded!'));
        }
        redirect(get_url('plugin/file_manager/browse/'.$path));
    }

That i see in the err_log of my host:

[Fri Jul 10 09:22:52 2009] [error] PHP Warning: Unknown: open_basedir restriction in effect.
File(/var/tmp/) is not within the allowed path(s): (/home/u17629/) in Unknown on line 0
[Fri Jul 10 09:22:52 2009] [error] PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0

What can i do?

 
Avatar
58 posts

Okay. Problem solved. The problem was the lack of rights for the tmp directory.

 
Avatar
5 posts

Hi, anyone here who can help me with the same problem? I’ve tried checking the steps stated here and still found no luck. I also get this File has not been uploaded error. I am thinking that this has got to be a problem with my web hosting service now. I will try scanning the log in case the problem lies within somewhere.