Hi there,

I am trying to create Image content where in the images are stored in a folder inside the files/images folder. I did go thru the patch where each user has a subfolder to save their images. But I dont want a patch.

I exactly want to know which file do I have to hack ( hacking is not a nice thing but I am trying to get to know the backend files how they work) to get my image content to render properly.

I tried hacking the image.module's "_image_filename" function by appending the subfolder name to the $path variable. All it does is put the thumbnails in the subfolder and the original images seem to be not stored anywhere.

Anyone knows how to do this?

Thanks

Comments

spiffyd’s picture

Assuming you want automatic folder creation, you're looking at Token support.

See my post: http://drupal.org/node/296969

Drupal User-1’s picture

Thanks for the prompt reply spiffyd but I have a predefined set of folders that I need and I want to put the images into those folders. Isnt there anyother way to do this?

spiffyd’s picture

Okay, so it looks like you're talking oranges and I'm suggesting apples. But there's a connection :)

The number of ways to do anything is limitless (It's basically up to the coder...) ;)
Right now, the features we're touching upon are requests - they do not exist yet... or at least that I know of.

Token support is a powerful way for the admin to specify paths for all users (and is particularly powerful when we're talking about multiple users). You don't want everyone lumping their uploads in one single folder do you?

I guess what you'd like to do is the following...

You have all the files named as you want in specific predefined folders named however you want. You place all that in the import directory. After import, nodes will be created for each image.

- Galleries will be created based on predefined folder names
- Folder structures will be retained after node-creation and import (as orig imported imgs will be moved to image default path)

Si or no?

Hetta’s picture

Status: Active » Closed (duplicate)

duplicate of http://drupal.org/node/103793 - test dman's patch over there.
Also, naming galleries by predefined folders during import is implemented here: http://drupal.org/node/225014

Drupal User-1’s picture

Well I dont have the files in advance. Users create image contents that will be redirected into a subfolder (nothing related to the users) based on some session variables that I am using. And I dont want galleries to be created.

Sorry for being so fussy .