Whenever I try to upload an image with image picker, I get the error message

Unable to create a directory structure for your images.

I can upload images manually (through file attachment) without problems. File "Download method" is set to private. Any idea what's wrong?

Comments

vm’s picture

where is your private directory at? is it above the public root? if not your files aren't really private. Though that is a separate issue.

consider creating the directory manually and point to it in the settings of the module itself.

I found this: http://drupal.org/node/308831

where the developer states he/she doesn't use private upload method.

rene_w’s picture

Yes, my "files" directory is outside the public html root directory. I've tried to create the "imagepicker" directory manually but that didn't change anything.

I did read the mentioned post about "Private file /upload/ not supported", but it wasn't (and still isn't ;) clear to me what the connection with the private /download/ method is? As I mentioned, uploading an image (without image picker) as a simple file attachement works just fine.

vm’s picture

the upload.module in core supports private uploads as core itself supports this feature. This would be the difference between the two I'd guess.

My best guess is that it has something to do with the path that the private method uses verses the public method as the public method is simply a link directly to the file and the private method is a link with 'system' in it which makes it harder for those to get at the files because they don't know the exact path.

goye2cz’s picture

I'm having the "Unable to create a directory structure for your images." issue as well. I have one site that seems to be without problem. It's on my local hard drive. I've backed up that website and installed it on my webhost for a couple of sites. Of course I created a new database and modified the settings.php for drupal. Everything seems to work fine except imagepicker. WHY? Has anyone found a fix for this?

Is there some code in imagepicker that makes it look on a certain file path for something that would be different if you backed it up and installed drupal in a different directory or server?

Thanks.

goye2cz’s picture

*Update*

I am a noob to this but it seems that the problem is directly related to what I described, at least in my case. I did a fresh install of drupal on my web server and added image picker and it works beautifully. It does not work when I simply back up a site and move it to another location.

Any guesses on how to resolve that?

hutch’s picture

The "Unable to create a directory structure for your images." issue is caused by bad permissions on the files folder and/or those below it. When you move a site using ftp you will inadvertently alter those permissions. You can use your ftp client to set them to 'world writeable' or whatever your software calls it.
see
http://drupal.org/node/34023

pyotr777’s picture

Have the same problem. It doesn't have to do with permissions.
I gave full permissions to files, files/imagepicker and all folders inside it, but still have the problem.
Upload method is set to public.
Cannot find any configuration of imagepicker module.
BTW, I use Drupal 5.15.

goye2cz’s picture

Just confirming that the permissions were not the issue. The permissions were set correctly and it still did not work. I see that there is now a new version of ImagePicker. I disabled the old, uninstalled, then deleted it. I uploaded the new, enabled, and now it works fine.

vm’s picture

Status: Active » Fixed

Thus others in this thread should also update to 6.x-1.3 and reopen if the issue persists.

rene_w’s picture

Status: Fixed » Active

My original bug report was that Image Picker doesn't work when Drupal is configured to use the "private" file download method. This has not been "fixed" at all.

However, since there are quite a few more bug reports with the same issue #206800: Have Image Picker to work with filesystem set to private, #308831: Private file upload not supported, it probably makes sense to keep only one of them around and mark the others as duplicate.

But, at the very least, this restriction should be clearly stated on the project page and/or the readme file! Lest someone else wastes a lot of time trying to get a perfectly normal configuration to work that is known to not be supported...

vm’s picture

Status: Active » Closed (duplicate)

since the developer responded in the thread you link to and since this thread is now cluttered ...

marking this as duplicate of: http://drupal.org/node/308831

hutch’s picture

'public' files are stored under the document root of the domain concerned.
'private' files are stored outside the document root.
Therefore only public images can be accessed directly from a web page. Privately stored images would have to be accessed via a url that could interpret the request so as to open the privately stored file and stream it directly to the browser as a download, not much use for images in a webpage.
That is the reason why 'private' makes no sense for images embedded in a webpage and why it cannot be 'fixed'

I will put a note on the imagepicker page for those who do not understand these differences.

rene_w’s picture

Even with the private download method, files can be stored under the document root, so this has nothing to do with the download/upload problem.

"Therefore only public images can be accessed directly from a web page." This is utter nonsense. Images (whether directly attached to the node or stored in an Image node) can be embedded in a page with a URL (or with a filter tag) with or without using private download.

For those who do not understand these differences, I suggest having a look at the Image Assist module, which has no problem uploading or displaying images when using the "private" file system method. I use it for images on my site now, and yes, they display perfectly normal like any other web page with images...

abutze’s picture

I have the same problem.

My host is running safe_mode on. Could that be the reason why I get the error "Unable to create a directory structure for your images." ?

abutze’s picture

Okay, I've found out that this is the reason why I can't use the module.

imp_squared’s picture

And what was this reason why you can't use the module?