Hey,
I have a custom module on my site using hook_nodeapi which basically updates another table with the path to the file uploaded when a node is created or updated.
I'm using: $node->field_image['0']['filepath'] to get the path. But although I'm able to get the right path for the file, I am unable to get the updated file name.
for example:
file uploaded by user: user_picture_of_London.jpg
path settings: pictures/cities
rename settings: [uid]-[cityid].[fileExtension]
instead of getting something like: "pictures/cities/1-21.jpg"
I get: "pictures/cities/user_picture_of_London.jpg"
I can SORT OF overcome that by reconstructing the token in my module and recreate the file name but then I have a problem with getting the right file extension (could be jpg, gif, png etc..)
Is there anyway to overcome this problem in a more efficient way?
Thanks for the help, and thank for this great module!
Comments
Comment #1
thornag commentedHi guys,
Bumped into the same problem here today.
I've got an action to trigger xmlrpc call to our conversion boxes, whatever node is being put on the action input during save has the uploaded filename and not processed by filefield.
I could construct the filename myself but then it beats the config functionality.
Is there any API that could be called to convert the filepath?
Comment #2
alangbrown commentedBump...
Comment #3
decipheredNo longer supporting Drupal 6 issues for this module.