Hello,

When I create an image node, I get an error message :

The removal of the original file C:\WINDOWS\TEMP\tmp798.tmp has failed.
The selected file D:\Inetpub\wwwroot\MySiteFolder\files could not be copied.

There are no images attached to the post.

Permissions are OK.
I have tried tips from http://drupal.org/node/84405

I have read that there were problems with image module and PHP 5.2. Is this the case with version 5.x ?

Thank you.

Comments

Joe One’s picture

I have exactly the same problem.
I get the error message "C:\WINDOWS\TEMP\tmp838.tmp" could not be copied.
But then I also see "The Image has been edited" confirmation.

Is there some way of finding out why the file could not be copied?

drewish’s picture

Category: bug » support
Priority: Critical » Normal

my guess would be that your webserver is limiting the uploaded files to a certain file size. you should try uploading a smaller file.

the audio module displays a the maximum upload size next to the browse button using code like t('The current PHP configuration limits file uploads to %maxsize.', array('%maxsize' => format_size(file_upload_max_size())));

AstaC’s picture

I have two testsites on the same server. In one of them I get exactly this problem, on the other it works fine. Haven't got a clue why. But it has nothing to do with size.

drewish’s picture

what do you have set as the image modules' files directory? on both sites?

AstaC’s picture

images. Which is the same as files/images. It looks exactly the same on both sites.

drewish’s picture

i've run into problems with simply using 'images' i've had to use 'files/images'

flebas’s picture

I think the problem may be related with Drupal's temporary files directory settings.
If I enter an absolute path, file upload works. I have not yet tested with images.

Joe One’s picture

Tried about everything mentioned. Still isn't working.
I think the problem can be found in file.inc, where there is a function called 'file_copy'.

The error warning ('The selected file C:\WINDOWS\TEMP\tmpC56.tmp could not be copied to files/ikke.jpg.') is generated in this function on line 377. I've added the $dest to provide some more information.

Strange thing is that when i upload an image, the resize function returns an "everything ok" message.

Could the problem be related to the "copy" PHP function?

sfa’s picture

I'm having the same problem, I've tried everything suggested and just cannot get it to work.

sfa’s picture

Had a last go at this and finally managed to get it to work. It seems to be a problem with the permissions on the temporary file. By default the temp file seems to be "c:\windows\temp". I created a temp file in the druipal installation, went to Administer > siteconfiguration > File System and changed the "Temporary Directory" to the new folder. It's now all working fine.

Hope this helps!

Joe One’s picture

Hi sfa,

what exactly did you enter in this field?

On this screen there is a warning at the field with the "files" location that if you change this while this is already used, this will generated problems. What kind of problems can i suspect? The one that i'm experiencing now on two different webservers, one windows IIS 6, the other one an Apache server...

I'm getting a bit desperate here...

flebas’s picture

You must enter an absolute path for Drupal temporary files directory (e.g. d:\inetpub\wwwroot\drupal\files\temp).
You must also set permissions of the internet server user (IUSR_server for IIS) to read, write, delete for this directory.

drewish’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)