I have read several threads about the user settings module not being able to find the picture image directory, returning with "The directory does not exist." after I submit the user settings data.

I experienced that users could not display their images frontend - only when they were editing their profiles. Therefore I tried to alter the "Picture image path". Now I cannot make it accept any kind of path; says that whatever directory I try it does not exist.

Any help is appreciated,
Svend

Comments

STNyborg’s picture

Priority: Normal » Critical

Would it help to uninstall (?) and reinstall the user module - can one do this? Guess that the system is confused about where to store the picture image path.

Please advice.

Svend

STNyborg’s picture

Status: Active » Closed (fixed)

When adding a tmp folder to the files folder the problem was solved.

prabuthiru’s picture

the same problem occur again

mizengineer’s picture

Version: 5.7 » 6.9

You have to make path like this:

default/files/tmp/pictures

Hope that helps.

Can the directions/caption to enable pictures be changed in Drupal 6.10 ? Or eliminate this tmp directory completely?

Thanks :)

geerlingguy’s picture

Version: 6.9 » 6.14
Category: support » bug
Status: Closed (fixed) » Active

This bug keeps cropping up, especially when either (a) you move the files directory, and (b) you use drupal multisites (e.g. have /sites/example.com/files/pictures)

I have had two sites in the past week (one a clean install into a multisite directory, without ever moving any files, and the other a move from the /sites/default/files to /sites/example.com/files) have this exact problem.

I try uploading a picture for a user, and get:

Failed to upload the picture image; the users/pictures directory doesn't exist or is not writable.

And when I try updating/changing/anything to the "Picture image path:" on the admin/user/settings page, I get:

The directory does not exist.

I notice this problem has cropped up over... and over... and over... – here's a forum topic on the same: http://drupal.org/node/148601

I hope this is not a duplicate issue...? Also, should it be pushed forward to 7.x then backported? I don't know if it's been fixed for 7 yet.

kasiawaka’s picture

I had the same problem, I enabled picture support and added
Picture image path: avatars
I created a folder in sites/default/files/avatars and changed it's permissions to 777.
When trying to save the changes, I was getting an error
"The directory avatars does not exist"

I followed #4 instructions, created also folder sites/default/files/tmp/avatars, changed tmp and tmp/avatars permissions to 777 and it WORKED.
Thanks for your help.

tinker’s picture

I had the same problem on one install after an upgrade. I ran the update script after unpacking the files. No matter what directory was specified the form submit would fail because "the directory does not exist". I managed to track this down to a faulty variable. I don't know how this happened but in my database the variable 'user_picture_path' was set incorrectly to plain text 'images/users' instead of the serialized version 's:12:"images/users";'

It seems that the 'variable_get' caused a cascaded problem through 'file_create_path' and caused 'file_check_directory' to fail.

Now that the variable is set correctly the User Settings page works correctly and I can change the directory to anything. With a new directory being created if it does not exist.

m_i_c_h_a_e_l’s picture

I just looked at my database, and I don't have a 'user_picture_path' table. I don't know much about databases, so I might have looked in the wrong place. There are 4 or 5 'user_' tables.

I only ran into the problem after I tried to set the directory for using a new default avatar. Now, as mentioned above, it won't accept anything, even the word 'pictures' which was there before.

My users have been able to add pictures successfully up to this point. I don't know if this new "directory does not exist" error will cause a problem.

Any suggestions?

tinker’s picture

Look in the "variable" table. There should be a row where name = "user_picture_path". You could using the following SQL query to find it.

SELECT * FROM variable WHERE name="user_picture_path"

It should contain a value like:

s:12:"images/users"

The "images/users" part is the relative path within [site-root]/sites/default/files/.

The 12 is the number of character in the path so if you use a different path you have to change this number.
ie "pictures" contains 8 characters so the value would be:

s:8:"pictures"
m_i_c_h_a_e_l’s picture

Thanks so much.

I actually found it a couple of days ago, but your information is very helpful.

I did a stupid thing. When I browsed the "variable" table, it never occurred to me that there might be more than 1 page! Once I figured that out, I found the value, right where it was supposed to be.

Although I'm no expert, I always thought I knew my way around computers pretty well. Drupal has forced me to learn a lot more.

Always with help from the community. Thanks again.

cesar.romero’s picture

I must ask where [site-root] is defined. My "user_picture_path" variable is set to

s:8:"pictures";

And "file_directory_path" is set to

s:5:"files";

However, I keep getting the same error about the directory "pictures" not existing even though [site-root]/files/pictures and [site-root]sites/default/files/pictures exist and both are writable by apache.

Is it possible that drupal is using an absolute path using a value of [site-root] that I'm not aware of?

cyberwolf’s picture

Subscribing.

cyberwolf’s picture

For me the problem was solved by creating the directory currently set as picture path (by default user/pictures) under sites/default/files. It turns out that the error message shown is about the current profile picture path, not the new one entered in the form. The error message should be heavily improved as this is not clear at all right now. The comment on a related forum thread, http://drupal.org/node/148601#comment-830482, got me on the right track.

vasheck’s picture

Here's my fix for D6.17...

I went to File System (admin/settings/file-system) and checked the settings...
There was an error displayed because I didn't have the right temporary directory created under /sites/default/files/

...therefore I created a new "tmp" directory under /sites/default/files/tmp and put the values as follows:

File system path: sites/default/files
Temporary directory: sites/default/files/tmp

Afterwards, I went to under "User settings" (admin/user/settings) and put the following values in:
(given that I had the "pictures" directory created under /sites/default/files/pictures/

Picture image path: pictures
Default picture: pictures/default.png

Now, I'm not getting any error messages...

Hopefully, someone will find this helpful.

hualahyja’s picture

I found that although I changed the variable value in the database, it seemed to take the old folder name set before.
In this case I just cleare the cache and everything worked.

raincloud’s picture

After trying all tips from all possible threads, I still had the "Directory does not exist" error.
Then I logged out, cleared session cookies, cleared domain cookies, cleared cache, logged in. The error is gone!

AliMartin’s picture

Title: User Settings - picture directory does not exist ??? » Check your "file_directory_temp" setting

Hi

I also had the same problem but, following all the good advice in this thread, also realised another gotcha.

I migrated a development website from my Windows laptop to my web server, only to see the same picture folder issue suddenly happen. The SQL transfer was done using Navicat and it's a great tool for looking at the tables, etc.

Yes, I had the pictures and tmp/pictures folders created with 777 permissions and the correct "user_picture_path" setting in the "variable" table.

However, there is also the "file_directory_temp" field and my value was set to the old Windows installation path, i.e. s:11:"c:\wamp\tmp

When I changed this to s:4:"/tmp" (not forgetting to have created the "tmp" folder with 777 permissions) I was able to save the "pictures" setting.

Hope this helps :o)

Ali

grendzy’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Closed (fixed)

This isn't a critical bug; as several posters have discovered it's the result of configuration or permission problems. Further discussion is welcome in the post-installation support forum: http://drupal.org/forum/22

sarav.din33’s picture

Hi friends,

I dont know how to give the 777 permission to a folder in windows OS...

Guide me on this issue...

prokopton’s picture

Here's what worked for me on Ubuntu 10.04 LTS and PHP 5.2.x:

chown -R www-data:www-data /var/www/files/pictures/

chmod 775 /var/www/files/pictures/

You might want to use 777 if 775 doesn't work.

topdawg’s picture

Version: 6.14 » 6.19
Issue tags: +user pictures directory

Hi tinker, thanks for this post because it worked after close to 2 hours of hair tearing (not too much hair left to begin with.)

I'm not sure of the exact reason but the SQL query was right on and it showed that only the first entry remained and nothing was saved beyond that. So I put in the new directory 'images/users' counted chars including the '/' and got 12 and entered that. Oh, I had a different directory and went back to the images/users because that's OK with me especially if I can move on with this.

I'm on 6.19, tried my Mac, Windows, Linux no dice but this worked.

Joe

fowlerjb’s picture

I had the same problems, followed the instruction in #9, cleared my browser cache and cookies and flushed the cache in Drupal...and it worked.

Thanks AGAIN to this awesome community!

geerlingguy’s picture

Title: Check your "file_directory_temp" setting » User Settings - picture directory does not exist ???
Version: 6.19 » 6.x-dev
Status: Closed (fixed) » Closed (won't fix)

Updating title, version and status... just to make it make more sense.

hermes_costell’s picture

Status: Closed (won't fix) » Active

Not a critical bug?!

I just encountered this issue and was forced to go directly into the database as post #9 put forth and then clear the cache to make the page wake up and notice. Setting the value via the page's form was absolutely impossible in this case. I chmodded the file structure to no avail. Going directly into the database and modifying the value directly the page then shows no error - when I put in the very same value I was attempting to put in via the form.

The rest of the items on the page (signature support, email customization, etc) cannot be saved because of this bug. Even setting it to "disabled" the mechanism still tries to validate the picture url!

Claiming it's not a bug because some people said it was the result of configuration or permission problems on THEIR PARTICULAR SETUP doesn't mean it's not a bug for OTHERS.

Edit: Please note I didn't catch that the status of the issue had been changed to Closed - won't fix rather than Closed(fixed). I cannot undo the "active" status I just gave the issue via this interface. Mods please?

hermes_costell’s picture

Status: Active » Closed (won't fix)

Aha. I can change the status with a new comment. Okey dokey. Changing back to what geerlingguy had it as.

jalane81’s picture

I've had this issue for almost 2 years and just didn't have time to care until tonight. Followed this thread and fixed the problem.

Had to change the variable value in the DB to 'tmp/pictures' and flush cache.

Thanks!!

eckersley’s picture

Version: 6.x-dev » 7.12

Greetings – I actually had this very same trouble… my user images stopped showing in the profile pages or elsewhere (actually, in Drupal 7) after I had changed a download setting in Configuration>Media>Filesystem. I found the simple fix was to change back to Default download method: Public local files served by the webserver.

I will try the above methods and report back if they resolve the issue when using the private local files setting by Drupal. When the images were not showing I noticed that my thumbnails were reported by my browser's Inspect Element tool to be in a subdirectory that did not even exist (localhost:system: etc). When I created the non-existant subdirectory and place an image in it, it would still not display.

deanflory’s picture

I had a bad path in mine that somehow ended up "locking-up" my ability to change the pictures folder/path setting. Nothing would work, no location, no folders or permissions on folders, nothing. It somehow got set to some "private://private://foldernamehere/[username ]/profile_pictures" path, don't know how the double private prefix got there, maybe an autofill of a form screwed with me.

I then saw elsewhere that someone had to change the variable directly in the database, but when you get there, it's in binary and not editable.

  1. So what I did was create a text file (.txt) of I'm guessing any name, and within that I simply put the text "pictures" (without the quotes).
  2. I had already created that folder via FTP at sites/all/files/pictures.
  3. Using phpMyAdmin, I uploaded the text file to the "variables" table > "user_picture_path" > "value" file uploader mechanism, clicked "GO" and it saved and I saw the byte count change.
  4. I then went to the /admin/config/people/accounts settings and changed "Picture directory" to "pictures" and submitted the form. It then did not give me an error about an invalid path and I was then able to change it to my actual pictures folder path.

Hopefully this helps someone that's pulled ALL their hair out trying to work around something I believe is a pretty serious bug. No path should cause additional editing of the form field submission to be successful. Done, now back to actual work (or in Drupal speak, debugging even more lazy errors).

musubi’s picture

thank you deanflory this worked for me :)

nanabrownee’s picture

Issue summary: View changes

@deanflory thanks for this - saved me a LOT of time