Hi all

I installed drup on the server from my hosted providor.
Now when I want to upload a picture to my user account i get this error

warning: htmlspecialchars() expects parameter 1 to be string, object given in /home/httpd/vhosts/colemont.org/httpdocs/includes/bootstrap.inc on line 552.
The selected file could not be uploaded, because the destination is not properly configured.
warning: htmlspecialchars() expects parameter 1 to be string, object given in /home/httpd/vhosts/colemont.org/httpdocs/includes/bootstrap.inc on line 552.
Failed to upload the picture image; the b/pictures directory doesn't exist.

but the directory is in the /httpdocs/files dir
and when I try to create the pic library I get this error

warning: htmlspecialchars() expects parameter 1 to be string, object given in /home/httpd/vhosts/colemont.org/httpdocs/includes/bootstrap.inc on line 552.
The selected file could not be uploaded, because the destination is not properly configured.
warning: htmlspecialchars() expects parameter 1 to be string, object given in /home/httpd/vhosts/colemont.org/httpdocs/includes/bootstrap.inc on line 552.
Failed to upload the picture image; the ../pictures directory doesn't exist.

Can anyone help me?
Please note that it is on a hosted server, so I don't have ssh access,... I can edit files with ftp, or db with phpadmin

Comments

greggles’s picture

What are the permissions on the files directory? You can find this using your FTP client (exact method depends on which client you use).

--
Knaddison Family Blog

bcolemont0128’s picture

777

but if I try do drag a file with the ftp client to /httpdocs/files/picures it works

but when I set /pictures in the configuration I get :

warning: mkdir(): Unable to access in /home/httpd/vhosts/colemont.org/httpdocs/includes/file.inc on line 85.
The directory does not exist.
The settings have not been saved because of the errors.

Apstar’s picture

I have got exactly the same problem. I don't even try to upload a user avatar.
Can't figure it out. Already created a brand new directory images in the files directory.
When I add an avatar to a already exsisting user, it uploads just fine... ???

Burnspot’s picture

Same issue. I have the appropriate directory set to 777. I can even DISABLE pictures for users...the user sees no option to upload a photo, but if they try to make changes to their profile, Dru will give an images directory not found error. Puzzling....plus it prevents the user from making profile changes because of the error.

sinasalek’s picture

Same problem! seems that it can't see pictures folder!!! any idea?!

sina.salek.ws, Software Manager & Lead developer
Feel freedom with open source softwares

greggles’s picture

/pictures

I believe that the directory should not have a leading slash on it, but should be:

pictures
just the word all alone. If you enter
/pictures

Then it will look in the / (root) directory of your server for a "/pictures" directory which will not exist, or which you will not have permissions on.

--
Growing Venture Solutions
Drupal Implementation and Support in Denver, CO

sinasalek’s picture

i did, but i still have problem, drupal doesn't accept it!
it gives me below error , but i can't see any invalid entry! :
warning: mkdir(): No such file or directory in /home/tehlug/public_html/drupal/includes/file.inc on line 90.
directory doesn't exist
The settings have not been saved because of the errors

I can attach file to the nodes via upload module, there is no problem but i can't save user settings because drupal can't find "pictures" folder. it's permission is 777

any idea?!

sina.salek.ws, Software Manager & Lead developer
Feel freedom with open source softwares

greggles’s picture

Ok, how about you try deleting the pictures directory and then saving the settings again. I believe that drupal will try to create the directory for you.

--
Growing Venture Solutions
Drupal Implementation and Support in Denver, CO

sinasalek’s picture

i tried that one too, but drupal still gives me the same error!!
can your users upload their pictures without any problem, and see their uploaded pictures in their account?

sina.salek.ws, Software Manager & Lead developer
Feel freedom with open source softwares

greggles’s picture

Yes, this has worked fine for me on several sites.

The only times I've had problems with this issue were related to three things:

1) permissions on the files/pictures (or similar) directory
2) ownership on same directory
3) existence/ownership/permissions on the temp directory

Problem number 3 just happened on Thursday. Perhaps that is your problem as well? Do you have a proper tmp directory set in your admin/settings and do you have the right permissions on it?

--
Growing Venture Solutions
Drupal Implementation and Support in Denver, CO

sinasalek’s picture

yes i have, i can change admin/settings "file" & "temp" folder to whatever i want without any problem.
as you told, maybe my problem is third one! i have checked existence & permissions, so there should be something wrong with ownership! the site is on share hosting so i have no idea!
i set a default picture but it doesn't work too!

i don't have this problem on my local server (Windows), but i have another problem! i can upload or delete user photo , but it doesn't show in user profile and i just see a link that doesn't work either!

any idea?

Thanks

sina.salek.ws, Software Manager & Lead developer
Feel freedom with open source softwares

Randy Thornton’s picture

I had exactly the same problem when installing 4.7 from scratch today.

I fixed this by giving full permissions to the files directory, so it had execute rights, eg. from /drupal I do chmod 777 files, then the script created the files/pictures subdirectory for me (as it should according to the code in file.inc.)

BTW, I noticed that even when I changed the name of the pictures subdirectory in the config screen to something else, eg images, it would still say in the error message that it could not create the directory "files/pictures."

I think this could all be done in the install. Having to muck about with chmod is okay if the install tells me to, and I know to do it, but I should not have to find this out via cryptic error messages in settings screens.

--
Randy Thornton
University of Puget Sound
http://www.ups.edu

Shivian Balaris’s picture

Not sure how it related, but I was having this problem until I turned off the Image Exact module ((shrug)) hope you find what you need!

sinasalek’s picture

hello guys,
finaly i came up with this problem! hope it helps:
temporary solution

salek.ws
Feel freedom with open source softwares , tehlug.org

sina.salek.ws, Software Manager & Lead developer
Feel freedom with open source softwares