Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Deciphered CreditAttribution: Deciphered commentedThe 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.
Comment #2
Roulion CreditAttribution: Roulion commentedOK thanks, i try it tonight and tell you if it's ok
Comment #3
Roulion CreditAttribution: Roulion commentedmy 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?
Comment #4
Deciphered CreditAttribution: Deciphered commentedFirst, 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.
Comment #5
Roulion CreditAttribution: Roulion commentedi use de correct token, i didn't remember the exact name and my memory_limit is 128Mo
Comment #6
Deciphered CreditAttribution: Deciphered commentedHi 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.
Comment #7
kenorb CreditAttribution: kenorb commentedLinks to other bugs related to '134217728 bytes exhausted' issue:
Watchdog - #167424: Cron jobs fail, all connected functionality (search, other modules) ceases to work
Content Access - #145523: Unable to rebuild permissions or install/uninstall module
IP to Country - #115027: Out of Memory on Install
Contemplate - #230885: CCK activates triggers Fatal error
Devel - #234581: Fatal memory size error #229386: Memory leak
Subscriptions - #211070: 1.x - Fatal error: Allowed memory size exhausted in subscriptions.module on line 878
Simplenews - #205798: "Fatal error: Allowed memory size of"...When I click on drupal/?q=admin/content/newsletters/settings
Content Management Filter - #324351: Pager not keeping accurate records on filter
Node import - #235433: Out of Memory error when running any import #246746: loop error
Comment #8
hedac CreditAttribution: hedac commentedI 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.
Comment #9
mudd CreditAttribution: mudd commentedSame 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.