I use filefiel path for multiple upload with "imagefield". My pictures are uploaded with the path file/[nid]/image.jpg
The first upload works correcty but with the second, instead of uploading the image in the nid folder (for example74), it creates a "[nid]" folder in which picture is uploaded...

Comments

Deciphered’s picture

Status: Active » Closed (works as designed)

The way the module works is it uploads to a temporary directory ('files/[nid]' in this case), then after you save the node it will process the tokens ([nid] becomes the actual node id).

If you have multiple images being uploaded with a filename pattern, you need to make sure that the pattern will have something unique for each file, such as the files id ([filefield-fid]) provided by filefield tokens.

It is evident that more documentation needs to be provided to explain how the module works.

Roulion’s picture

OK thanks, i try it tonight and tell you if it's ok

Roulion’s picture

my filename is [fileid].[file-extension]; i desactivate pathauto setting, lower case and transliteration.

for a node i upload 3 pictures.
the first is uploaded alone and i save the node
the i edit the node and add 2 more pictures.
i get a "Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 24576 bytes) in C:\wamp\www\afterfoot\sites\all\modules\cck\theme\content-field.tpl.php on line 49"

the first is correctly uploaded in my nid file. The second stays in the [nid] file and keep its name instead of being rename fileid.jpg

looks like something wrong ? what did i miss?

Deciphered’s picture

Status: Closed (works as designed) » Closed (fixed)

First, there's no such token as [fileid] (that I know of), the one that comes with filefiled tokens is [filefield-fid].

Secondly, as I stated before, the moving to the correct directory and renaming doesn't happen till you save the node, that means whether you are creating the node the first time or editing the node.

As for the error, I believe you may need to allocate more memory to your PHP.ini.

Roulion’s picture

i use de correct token, i didn't remember the exact name and my memory_limit is 128Mo

Deciphered’s picture

Hi Roulion,

Either way, the only thing I can see here related to FileField Paths is the fact that the files where uploaded to the temporary path ([nid]) and the file name wasn't renamed, which, as I explained, is the expected behavior.

hedac’s picture

I have seen that if you upload a file it uploads it to the temporal folder.... but oh... you did a mistake and uploaded a bad image... then go and reupload the image and REPLACE the imagefield with another image... cool... now there are two images in the temporal folder... when I press save only the current image is moved to the final folder and the [nid] still have the first image file and the thumb.

mudd’s picture

Same problem here. I've tracked mine down to the combo of FileField Paths + Pathauto.

I'm using Drupal 6.10, and FileField 6.x-3.0-alpha7 (I've have not tried Feb-3rd dev build.)

If I upload 3+ files, regardless of name similarity, I get an error with either /var/www//includes/theme.inc or sites/all/modules/cck/theme/content-field.tpl.php. Eg.:
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 30720 bytes) in /var/www/blah/sites/all/modules/cck/theme/content-field.tpl.php on line 49, referer: http://blah_di/blah_di/blah

I upped allowable php memory, then php script executoin time -- etc, etc -- there must be a runaway loop.

Does this seems like it's related to this thread regarding recursion? http://drupal.org/node/311526

My setting are:

File path:
[user]/[title]

File name:
[filefield_paths-name].[filefield_paths-ext]

I'm using "Cleanup using Pathauto" on just the path (not the file name).

I've tried stripping Pathauto down to the bare minimum, but haven't stopped the behavior.

Also, file description field is not working. I've tested in many browsers (IE7/6, Opera, FF2/3, etc). Same.