Closed (fixed)
Project:
Upload path
Version:
5.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
4 Apr 2007 at 01:27 UTC
Updated:
4 May 2007 at 20:02 UTC
I'm tried this module on Drupal 5.1, but it seems I still encountered problem when I used it. FYI, I've installed and activate UploadPath & Token Module, set the location of uploaded files will be in the UploadPath configuration but still when I upload a file as an attachment, the file was still uploaded to /files/directory.
Comments
Comment #1
michelleI just did the same thing and got the same result. I'm using [user-id] for my token.
Michelle
Comment #2
Tom-182 commentedThis is actually a great module that everyone has been waiting for. If only the developer can fix the problem. I only hope this kind of module will be included in the upcoming version of Drupal package.
Comment #3
Crell commentedPlease keep the title consistent. Thanks.
I doubt this module will be included in Drupal core. If token module gets integrated then it would make sense, but not otherwise.
As for the bug, can you try other tokens and see if they work? I was originally testing with the global current user as a token. Does that work for you? Is it the user id of the node or the user id of the currently logged in user that doesn't work? Details please. :-)
Comment #4
michelleI tried it with [user-name] and it worked but then I had another thought. When I did it with [user-id], it was on a comment so I replied to the post and tried again. Sure enough, it put it straight in /files. So I think the issue may be whether you are uploading to a node or a comment. At least for me. I don't know about for the OP.
Michelle
Comment #5
Tom-182 commentedI tried using [user-id], and it works. But when I add other tokens into the path e.g [user-id]/[user-id]/[site-date] it didn't work.
I also notice that when the file was uploaded the url in the "File attachments" is still in /files/file-name, but when we submit the node, the url & file location change according to our upload path :).
Comment #6
Tom-182 commentedSorry, what I meant was [user-name/[user-id]/[site-date]
Thank you.
Comment #7
michelleIn my case, the file is still in the wrong place even after submitting. It sounds like we're not having the exact same problem after all. Would it be better if I filed my own issue?
BTW, why did you assign this issue to yourself? It doesn't sound like you're in a position to fix it...
Michelle
Comment #8
Tom-182 commentedHave you tried using [user-id] token? Coz it worked for me.
This is my first time posting an issue, so I didn't quite understand about the assign feature. Sorry :)
Comment #9
michelleYes, [user-id] is the token I started with and it works on nodes but not comments, as I mentioned above.
Michelle
Comment #10
michelleI'm withdrawing from this issue. I'd completely forgotten that attaching files to comments is due to another module, and not part of core. So my issue is with the modules not playing nice together, which has nothing to do with this issue.
Michelle
Comment #11
Crell commentedThere's a few things going on here.
1) Yes, this module only deals with uploads on nodes, not comments. I didn't even know there was a module to let you do uploads on comments until this thread. :-) That would be a separate feature request.
2) Yes, the Ajax'ed string is wrong. That's because at that point it says where the file "will be going" not where it is yet. I don't know if I can even hook into that process to update it. If it's possible, please file that as a separate issue.
3) Tom: The "Assigned" attribute is for people to step up and flag themselves as the person who will try to fix an issue. You are welcome and encouraged to try and fix the bugs you find, but if you're just reporting them then you probably want to leave it assigned to none. :-)
4) The actual problem here is that the Upload Path wasn't handling multiple directories properly. I thought file_check_directory() did that for me, but it didn't. :-( I've updated the code to handle multiple directory nesting properly and it seems to work in testing.
Committed to 5.x-dev. Thanks folks!
Comment #12
(not verified) commented