When I want to upload a theme it fails. I take the following steps:
- Log in as administrator
- Goto admin/appearance/install
- Try to upload a file:
- Get error message :
* Warning: move_uploaded_file(): Unable to access temporary://timo.zip in file_save_upload() (line 1486 of /public/sites/www.hartong.eu/includes/file.inc).
* File upload error. Could not move uploaded file.
- Message in log:
Type php
Date Wednesday, September 29, 2010 - 21:03
User Administrator
Location http://www.example.com/admin/appearance/install
Referrer http://www.example.com/admin/appearance/install
Message Warning: move_uploaded_file(): Unable to access temporary://timo.zip in file_save_upload() (line 1486 of /public/sites/www.hartong.eu/includes/file.inc).
Severity warning
And
Type file
Date Wednesday, September 29, 2010 - 21:03
User Administrator
Location http://www.example.com/admin/appearance/install
Referrer http://www.example.com/admin/appearance/install
Message Upload error. Could not move uploaded file timo.zip to destination temporary://timo.zip.
Severity notice

Comments

ipsitamishra’s picture

Hi,

I think you need to check the "Temporary directory" settings under File System (/admin/config/media/file-system) . The temporary directory should be writable so that it can create the 'update-cache' directory. Please try that and report if that works for you.

You can see my detailed reply for this issue at http://drupal.org/node/911222#comment-3517206

Thanks,

VVDFractie’s picture

Dear Mrs mishra,

Thank you for taking the trouble of looking into this problem. But my room to do things at my provider are limited. Ik kan not make directories in /home. I can only make directories in the drupal install directory. So I cann't say a /directory. Could this be a problem ?.

Thank you,
Timo

VVDFractie’s picture

Update:

- Made a complete new installation of drupal 7
- Filled in the directories 'File System'
- Directories are created by Drupal . I could see this with the ftp program
- Still I cann't upload any file
I only have the possibilty to create files in my domain. So I cannot make a /home/somethink like that .

webchick’s picture

Component: file system » update.module
Category: bug » support

/home/something/something is just one example. you could also put this directory at sites/default/files/temp. Ideally it's outside the web accessible directory, though. It's odd that your host doesn't let you create additional folders inside your user's home directory.

Unless this can be proven to be a deeper problem in update module (it sounds very clearly to be permission-related, which is a web host-specific thing), re-categorizing as a support request.

dww’s picture

Title: Upload a theme fails » Upload a theme fails when the temporary directory isn't configured
Status: Active » Closed (works as designed)

Yeah, you need to configure a temporary directory for the update manager to work. If you don't do so, you get all kinds of cryptic errors. That's part of what #605292: propagate failure during batches in update manager is supposed to try to fix. However, once you configure a temporary directory (and no, it doesn't have to be outside your webroot), the update manager works as expected.

We should probably add some checks in update manager so that if the temp dir isn't configured or writable, that we bail earlier with a clearer error message. @webchick: if you want that, let's set this issue back to an active bug and slightly re-title it. Otherwise, I guess (someday) we'll make all this UI not suck so much over at #605292, although I'm not sure if that's going to be possible in D7 at this point...

VVDFractie’s picture

Meanwhile we have it so far that we can create directories inside the home directory. But still no show. Now I did do some hacking...
When I change the lines in file.inc from ( from line 1486 )
$file->uri = $file->destination;
if (!move_uploaded_file($_FILES['files']['tmp_name'][$source], $file->uri)){
form_set_error($source, t('File upload error. Could not move uploaded file.'));
watchdog('file', 'Upload error. Could not move uploaded file %file to destination %destination.', array('%file' => $file->filename, '%destination' => $file->uri));
return FALSE;
}

to

$file->uri = $file->destination;
if (!copy($_FILES['files']['tmp_name'][$source], $file->uri))
{
form_set_error($source, t('File upload error. Could not move uploaded file.'));
watchdog('file', 'Upload error. Could not move uploaded file %file to destination %destination.', array('%file' => $file->filename, '%destination' => $file->uri));
return FALSE;
}

I can upload a file with a page. But the install process now fails somewhere else.
permission-related probably yes but where ?.