When using token with imagefield for creating separate path's for each page the token is not inserted correctly.

eg.
the path:
photos/[current-page:title]

generates an error when uploading a photo to the node "photogallery" of nodetype "photobook":
The upload directory public://photos/Edit photobook photogalery
for the file field field_image could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled.

I try to store the images in
photos/fotogallery

similar errors occur when using other tokens

Comments

Dave Reid’s picture

Status: Active » Closed (works as designed)

Yep there are some tokens that should not be used in a path context. That's why FileField Paths module exists.

rpmskret’s picture

I just had the same error come back to me .. "public://field/image for the file field field_image could not be created or is not accessible..."
Then I discovered that the directory the upload was intended to go to was [mydrupalroot]/sites/default/files/field/image.

It made sense when I found at : admin/config/media/file-system ,, the "Public file system path" setting was "sites/default/files".
So that public:// = "sites/default/files" and so public://field/image = "sites/default/files/field/image"
The directories were already there in this case but were not write permitted. I changed permissions to allow all to write to these "public" directories and then I could upload the images right away.

So you could check the existence of directories and/or the permissions at "Public file system path"/photos/Edit. However, I see your situations is more complex because you have " public://photos/Edit photobook photogalery" . But I hope this post might help.

spadstar’s picture

Yeah, just to add to romanse's comment on this, if you change the permissions of your default files directory, recursively (so that all sub directories are also changed), it may solve your problem. It did for me. I did this:
chmod -R ugo=rwx sites/default/files/

But then, I'm a f***ing numptie, so who knows if this is really the right way of sorting the issue....