hi everybody

i have problem with uploading file
im using drupal 5.1 , apache 2, php 5.2.2
everything in my system is ok but upload module doesn't work

1- i check access control and i have premission for uploading file
2- files and temp directory is created and premission set to 777
3- i changed files and tmp directory path to full path but it doesn't work
4- there isn't any error message in log files. it seems that everything work proprly but in fact it isn't.
5- when i want to upload a file the file will upload completely but there isn't any file on server
6- i've used favicon back on trick that mentioned in of the topics but its not work for me

i spent 6 hours to solve the problem but i was not successful
please help me :(

Comments

pbarnett’s picture

Hi.

Can you upload small files, or won't it upload anything at all?

Uploads will fail silently if the file size is greater than that allowed by upload_max_filesize and post_max_size in php.ini

clivesj’s picture

I have the same problem, and spending days to search for solutions:

Everthing seems to be OK: files_dir is writeble(admin|status), C:\windows\temp permissions are OK,

php.ini max upload= 8mb.

Now the strange thing:
The file IS uploaded to C:\windows\temp: The file is stored as a tempxxx.tmp and it has the timestamp of the time of submission and has the dame size of the file uploaded. So I asume the file is stored in C:windows\temp.

But then, apparently there is an error when the file is copied to "path.../files".

Any ideas??
I would appreciate any help since I'm breaking my head on this for a lot of days now...

(I don't have image module activated!)

phadez0r’s picture

clivesj - July 18, 2007 - 11:03

I have the same problem, and spending days to search for solutions:

Everthing seems to be OK: files_dir is writeble(admin|status), C:\windows\temp permissions are OK,

php.ini max upload= 8mb.

Now the strange thing:
The file IS uploaded to C:\windows\temp: The file is stored as a tempxxx.tmp and it has the timestamp of the time of submission and has the dame size of the file uploaded. So I asume the file is stored in C:windows\temp.

But then, apparently there is an error when the file is copied to "path.../files".

Any ideas??
I would appreciate any help since I'm breaking my head on this for a lot of days now...

(I don't have image module activated!)

Alright, I just fixed this. Set your temp directory to an absolute path, mine is c:\inetpub\wwwroot\drupal\temp in drupal. Then, set iusr and iwam to have full permissions for the file, temp and c:\windows\temp directories.

Steve Lockwood’s picture

I was having the same problem.

After reading the post here I was able to fix it by going into admin/file-system and setting the temporary directory to files/temp, i.e. a subdirectory of the files directory. I also created the relative directory files/temp using an FTP client.

Originally the temporary directory was c:\windows\temp but I don't have access to IIS, setting permissions or directory properties. All I have is FTP access to my webspace. But it seems setting it to a relative directory works OK.

Hope it's useful to someone.

Steve

davidrf’s picture

I had swapped a Drupal installation between servers and was going out of my mind trying to figure this one out. Changing the location of the temp folder was the solution. Thanks, Steve!

nimazuk’s picture

Is there an error something like this? the file .... could not be copied!

if you have IMAGE ATTACH module enabled, disable that module and check the upload again. several times I solved the image gallery upload problem with disabling the IMAGE ATTACH module. Maybe this work for you in this case.

N.Mehrabany
niGraphic web design & photography

Nima

clivesj’s picture

the file...can not be copied is displayed.
I do not have the image attach module.

I have tried everything, even resetting the default favicon path!

I'm currently looking into the clean URL-thing. I'm not using clean-urls but the php.ini files i see cURL.enabled, maybe....

phadez0r’s picture

Hey,

I've got this exact same problem, except I'm running IIS + Windows. Permissions to temp and files are both set correctly, and the files are showing up in c:\windows\temp. They just aren't being copied to the files directory in Drupal.

pbarnett’s picture

Hi.

I think that Steve Lockwood above is right; try changing the to temp directory to a subdirectory of files.
I suspect it's a result of the access rights that the drupal process has...

Pete

TimJFowler’s picture

I seem to be having the same problem with the Upload Module.

I'm using:
Drupal 5.2
MySQL database 4.1.21
PHP 4.4.7
Apache/1.3.37 (Unix)

File system path: files
Temporary directory: files/tmp
Download Method: Public

Maximum resolution for uploaded images: 0 (no restriction)
Default maximum file size per upload: 2 MB

When I click "Attached Images:", browse to an image (a 53K .jpg), insert a title, and click "Preview", the image will show correctly in the preview. But, when I click "Submit" the image is gone. The image file does not appear in the files directory and it definitely does not show on the website.

Any help would be appreciated.

TimJFowler’s picture

It was partially a problem with directory rights settings (set to 766 works fine) and partially a problem with Access Control settings for authenticated and anonymous users.

bbei’s picture

Could you describe exactly how you fixed this particular problem?

I think I set the permissions correctly on files and files/temp (which I created seperately).

Which Access Control settings did you alter?

I also have Drupal 5.2, the problem seems to be occuring the moment I switched from drupal 5.1 to 5.2.

abu3abdalla’s picture

dear all

the problem is drupal can not write on temp directory so if you change the permission of the directory that you guess it will contain the temp dir. the problem must disappear.

regards

please let me know whats happen?????????????????

Roger7’s picture

so I am not sure if this post is correct here.

Hi,

I have changed under Admin/File-System

upload_tmp to /upload_tmp

and now I am able to upload the logos and favicon.

Roger

PS: I am hosting on Servage.net and saw already more problems... I am sure I will need your help, too.

regx’s picture

if your server is using (php open_basedir Security) upload images does not work.
This seems to be the case even if you are using relative paths inside the users directory.

I tried every fix mentioned in this and several other post with no success.
As soon as I disabled php open basedir for the account in question everything worked.

It appears that /tmp or something outside the user base dir is being used regardless of the settings.
I am going to try puttin a php.ini in the users dir to see if that makes a difference as I would prefer to keep php open basdir enabled.

I will let you know what I find out.

My personal Drupal site.
http://www.regx.dgswa.com/html/index.php

regx’s picture

If I manually set upload_tmp_dir to /tmp then uploads work regardless of suexex or php open_basedir.
Uploads also seem to work now for both the private and http upload methods in Drupal.

When upload_tmp was blank "system_default" uploads would not work if php open_basedir was turned on regardless of the upload method.

I am running:
PHP 5.2.4 (cgi) (built: Oct 9 2007 08:17:14)
Apache/1.3.39 (Unix)

I hope this help someone else.

My personal Drupal site.
http://www.regx.dgswa.com/html/index.php

AeonX’s picture

I am having this upload problem too...

I want to try your solution, but have no idea how to set it up...

please explain it for a newbie hack like me!

Thanx

AeonX’s picture

If there is anyone else out there that doesn't understand how to modify the "php.ini" file first you need to know that it is not in the Drupal core... it is part of the PHP code on your server.

Contact your host &/or do a search on your favorite engine for "where is php.ini" to get some direction on where to find this file on your server, and how to go about making the above recommend change to this file.

It worked for me!!!

dex002’s picture

it worked for me anyway... I don't like bugging my host all the time, so I opted for the temp dir inside the files dir option. I created a temp dir inside files dir using my FTP client. I then changed the file system config so that the temp dir settings showed files/temp

It works, yay!

PS, thanks to whoever it was who suggested this way back at the top of this post!

Dex002